Commit Graph

41 Commits

Author SHA1 Message Date
Couriersud
b97ff5fcca Credit ShimaPong - Updated cheat system
- Roll back older periodic function
   Now standard/old format work in this function
   Otherwords, several operations which doesn't exist in older
   function and added recently are now disabled
 - Separated load_cheat_code() to 3 indipendent functions
   And added new cheat options, "Load New/Standard/Old Format Code"
   (Default : load all format codes)
     NOTE : delete all cheat options in the database before start
            or reload default options (Shift + Reload key)
            in cheat general menu
 - Added format strings structure to accept huge size strings
   in loading a database to prevent from breaking other strings
 - Changed Link in new format
   Label code is now "Link-Label" and sub-label is "Label-Sub-Link"
   "Standard-Link" is no longer label
 - Added choose_label_index() to manage label selection
 - Fixed build_label_index_table() to prevent from crashing
   And disabled to build label index table in case of
   standard/old format
 - Fixed memory free problem in case of standard/old code
 - Fixed several reported/found bugs
2008-07-01 22:53:31 +00:00
Nathan Woods
aa3dfa8811 MESS-specific compilation fix 2008-06-27 01:10:39 +00:00
Aaron Giles
3d1376ed97 Cleanups/version bump. 2008-06-26 16:05:46 +00:00
Couriersud
9e2e2fd776 Fixes menu scrolling speed as described by Haze 2008-06-25 22:17:15 +00:00
Couriersud
37ad515d2a Updated cheat system / Credit Shimapong
- Merged 3 different search menu functions to search_main_menu()
 - Added new cheat options, "Vertical/Horizontal Key Repeat Speed"
     NOTE : delete all cheat options in the database before start
            or reload default options (Shift + Reload key)
            in cheat general menu
 - Changed assignment of Entry for Activation Key and Pre-enable
   command code. Now there are check the tag in comment field
   instead of index number. But it's only for new format command
   and old is as before
 - Added tag output in save_activation_key() and save_pre_enable()
 - Cleaned up save_cheat_options() to output description
 - Changed memory read function in watchpoints
   No longer "Debugger" watchpoint mis-hit "Cheat" watchpoint
 - Fixed several reported/found bugs
 - Renamed funcitons/enum based on coding guidlines
   All functions are completed in this update
2008-06-25 18:24:55 +00:00
Aaron Giles
57c35a0efc From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] memory_region madness reloaded
Hi mamedev,

The memory_region and memory_region_length functions are probably the
two most common functions in MAME that don't take a machine parameter
but should given the syntax of the related apis memory_region_type and
memory_region_flags.  Clearly they didn't get the parameter because of
the sheer number of changes needed to change the apis.  This pair of
patches makes the change, and deals with the consequences.

The second patch then changes the api for memory_region and
memory_region_length, and fixes the fallout.  It generally plumbs
through machine parameters where needed, except for the case of sound
apis which I deferred doing so till later.  This increased the number
of deprecat.h includes by ~50.  Given it is a massive patch, there are
bound to be a few mistakes in it (I had to make ~20% of the changes by
hand), but I exercised care and reviewed the patch several times to
minimize the problems.
2008-06-23 08:32:42 +00:00
Nathan Woods
1c989c1f59 Typo fix 2008-06-13 00:18:48 +00:00
Aaron Giles
5a162da3d4 Cleanups and version bump. 2008-06-12 19:59:19 +00:00
Aaron Giles
9b80898ee0 From Shimapong
MAMETesters Bugs Fixed
----------------------
00277: [Misc.] groundfx.c, gunbustr.c, superchs.c, taito_f3.c,
       undrfire.c, psikyosh.c: Cheat search causes fatal error

Source Changes
--------------
Updated cheat system
 - Changed the function of default memory read in case of the search
   to prevent from crashing if a game uses cpu_spinutil()
   Now basically used do_memory_read() instead of do_cpu_read()
   (Try to search in actfancr between this and previous version)
   NOTE : It's not fundamental solution but no longer crash
 - Cleaned up read_data() and write_data()
 - Cleaned up save/load routine and added open_cheat_database()
 - Added new menu "Cheat Commands" into the cheat main menu
     the following commands are supported in this menu
      * reload cheat code (the same as Reload Database key)
      * cheats ON/OFF (the same as Toggle Cheat key)
      * watchpoints ON/OFF (the same as Shift + Toggle Cheat key)
      * save description (save the title of the game)
      * save raw code (save raw cheat code with new format)
 - Fixed several bugs which has found in testing
 - Renamed functions based on coding guidlines
2008-06-12 16:46:29 +00:00
Aaron Giles
1bc774b32b Cleanups/version bump. 2008-06-05 15:57:00 +00:00
R. Belmont
317607a143 64-bit GCC compile fixes. 2008-06-05 14:10:56 +00:00
Nathan Woods
5b94cc19d5 MESS-specific compilation fix 2008-06-05 11:12:33 +00:00
Aaron Giles
2deed30b29 Fixes for 64-bit MSVC compile. 2008-06-05 09:49:23 +00:00
Aaron Giles
7474bb220a MAMETesters Bugs Fixed
----------------------
- 01845: [Core] all games: cheats are broken
- 01846: [Misc.] -CHEAT trigger causes MAME crash with PSX-type CPU drivers

Source Changes
--------------
Updated cheat system
  - Locked search region when malloc fails to allocate gigantic memory
    instead of fatal error. Also locked zero malloc error in case of
    search speed = all memory in 32-bit CPU. And added search region
    range checker to lock a search region with a big risk

  - Fixed a bug that old code is always converted to specified
    separator in enable/disable menu

  - Refined new cheat format.
     * Rewritten cheat format again. newest format is
       ":gamename::type::address::data::extend_data:(description:comment)"
       Expanded type field now requires 10 bytes (not 8 bytes) and
       it divides internal cpu (2 bytes) and type (8 bytes) parameters

     * Removed VWrite, VRWrite. The flag of Value Selection is merged
       into expanded type field now.

     * Added CBit (Condition Bit). This checks bit in read data then
       set or clear bit in case of true.

     * Rearranged cheat code viwer based on newest cheat format

  - Fixed unworking Load Old Format option. If you want to load old or
    older format code, set it (default is OFF)

  - Renamed functions/structures based on coding guidlines
    All structures and included parameters are completed

  - Merged resize_*_no_dispose() into resize_*()

  - Removed the hack of search region for SH-2 CPU because required
    region is now set as expected without this hack
2008-06-05 08:46:48 +00:00
Nathan Woods
aa14505377 MESS-specific fix 2008-05-29 10:55:52 +00:00
Aaron Giles
c852c42952 Cleanups for 0.125u3. 2008-05-29 09:25:51 +00:00
Aaron Giles
7247ecbce2 From: ShimaPong
fixed Testers bug [01039]
-------------------------------

Updated cheat sytem drastically
  * Supported (preliminary) new cheat format
     - Added new operations
        PDWWrite, RWrite, VRWrite, CWrite, Move, Branch, Loop, Popup
     - Added new options
        ValueSelectNegative, Return, AddressReadFrom, DataReadFrom
     - Added cheat variables
        You can store data with Write or Move operations and
        read as an address or data from each fields
     - Added condition check
        for CWrite, Branch and Popup operations
     - Added new custom codes
        Separator, Layer
     - Supported Shared Code [MESS ONLY]
        different machine shares common code for a game

  * Allowed mixed label-select or user-select with standard code

  * Added label selector menu for label-selection code

  * Added extend comment displayer for multi-line comments

  * Added command menu for cheat list and watchpoint
     Easy selectable cheat commands in this menu

  * Added debug view menu [DEBUG BUILD ONLY]
     It displays internal info to debug cheat system

  * Supported unique separator by ui_draw_menu() in several menus

  * Added user defined search region
     You can set free memory range from cheat database

  * Enhanced error check for cheat code to prevent from unexpected working
     Error code is locked. If you select this code, the analyser works
     instead of the code activater

  * Enhanced value input with keyboard-less
     Cheat edit key gives new input system in several menus
     Left/right keys moves the edit cursor and up/down keys changes a value

  * Added cheat command save, reload, reset in option menu

  * Supported address shift in searching
     Now searchable default region in TMS340*0 cpu games (Trog, Smash T.V. etc)

  * Refined cheat menu handling with function pointer called cheat_menu_handler

  * Added format strings table to manage in an integrated fashion

  * Deleted unused hacks of default search region for Neo Geo and TMS34010

  * Refined code based on MAME coding guidelines
     - Renamed many functions/structures/constants
        But not complete due to too many items
     - Converted small but often used functions to INLINE
     - Fixed a comparison in case of 0 or NULL
     - Added missing function prototype for several functions
2008-05-29 08:54:21 +00:00
Aaron Giles
7cb1326459 Renamed EEPROM_* to eeprom_*
Typedef'ed a real eeprom_interface structure.

Added a PORT_CUSTOM for the eeprom bit reading. Updated several
drivers to use that by specifying it in their input ports instead
of having a custom read handler that inserted the bit forcefully.

Added a PORT_CUSTOM for the ticket dispenser callback as well.
Updated the dcheese driver to use it.

Many more drivers can be updated to use these new PORT_CUSTOMs
in the future, eliminating hacky input port read handlers.
2008-05-25 05:38:24 +00:00
Aaron Giles
096331c856 Restructured input port internals and cleaned up inptport.c:
* Input ports are now maintained hierarchically. At the top
level are input ports, which contain a list of fields. Each
field represents one or more bits of the port. Certain fields
such as DIP switches and configuration switches contain a
list of settings, which can be selected. DIP switch fields
can also contain a list of DIP switch locations.

* Normalized behavior of port overrides (via PORT_INCLUDE or
by defining multiple overlapping bits). All fields within a
port are kept in strict increasing bit order, so altered DIP
switches are now kept in the appropriate order. This addresses
MAMETesters bug 01671.

* Live port state is now fully separate from configured 
state. This is manifested in a similar way to devices, where
a const list of ports can be managed either offline or live.
Each port has a pointer to an opaque set of live state which
is NULL when offline or valid when live. Each port also has
a running_machine * which is also NULL when offline.

* Because of this new arrangement, the conversion from tokens
to a list of ports now requires reasonably complex memory
allocation, so these port lists must be explicitly allocated
and freed (they are not mantained by automatic resource
allocation).

* Custom and changed callbacks now take a pointer to a field
config instead of a running machine. This provides more
information about what field triggered the change notification.
The machine can be found by referenced field->port->machine.

* The inptport.c module has been cleaned up and many 
ambiguities resolved. Most of this is internal, though it did
result in osd_customize_inputport_list() being changed to
osd_customize_input_type_list(). The parameter to this function
is now a linked list instead of an array, and the structures
referenced have been reorganized somewhat.

* Updated config.c to pass machine parameters to its callbacks.

* Updated validity checks, XML output, and UI system to handle
the new structures.

* Moved large table of default input settings to a separate
include file inpttype.h.

* Removed gross hacks in trackfld and hyperspt NVRAM. These
may be broken as a result.
2008-05-15 16:25:03 +00:00
Aaron Giles
e621d87cfe From: Oliver Stoeneberg [mailto:oliverst@online.de]
Subject: MESS machine stuff

Another machine parameter added to a MESS function call.
2008-04-03 05:21:51 +00:00
Aaron Giles
d5561a8e75 Removed cpu_scalebyfcount().
Changed input ports to register a frame callback, which is
called immediately after throttling and updating. This is the
proper "sync point" between emulated time and real time. Moved
all analog and digital port processing into a central place
here. Added tracking of time since the previous frame update
and use that as an estimate for the time of the current frame.
This is used to scale analog ports without the use of
cpu_scalebyfcount(). This is not perfect in the case where
frame rates are dynamic (vector games), but works well for
other cases.

Further cleanup of memory header and code.
2008-03-12 05:13:03 +00:00
Zsolt Vasvari
77a58d253c - First batch of machine->screen[] access has been removed
- Added video_screen_auto_bitmap_alloc(screen) -- it is just a shorthand for 
  auto_bitmap_alloc(video_screen_get_width(screen), video_screen_get_height(screen), video_screen_get_format(screen))
  which is a common operation
- The Dynax/Don Den Lover games now do their updating in VIDEO_UPDATE instead of VIDEO_EOF.  This semmed to
  have fixed the palette problems
- Went through some of these drivers and changed Machine to machine
2008-03-11 08:37:05 +00:00
Aaron Giles
c4cfa7bde4 Compilation fixes for my last checkin (sorry). 2008-03-10 16:22:01 +00:00
Aaron Giles
0862cce453 Replaced the following macros (SMH == static memory handler)
MRA*_BANK*/MRA*_BANK* -> SMH_BANK*
   MRA*_RAM/MRA*_ROM     -> SMH_RAM
   MRA*_ROM/MWA*_ROM     -> SMH_ROM
   MRA*_NOP/MWA*_NOP     -> SMH_NOP
   MRA*_UNMAP/MWA*_UNMAP -> SMH_UNMAP

This removes the silly need for a bunch of redundant constants
with faux type definitions that didn't buy anything.

Moved some memory system constants into memory.c.
2008-03-10 02:29:15 +00:00
Aaron Giles
ddfc0c3259 WIP check-in. Things work now, but I'm still working on the code.
Converted address maps to tokens. Changed the address_map structure
to house global map-wide information and hung a list of entries off
of it corresponding to each address range. Introduced new functions
address_map_alloc() and address_map_free() to build/destroy these
structures. Updated all code as necessary.

Fixed several instances of porttagtohandler*() in the address maps.
Drivers should use AM_READ_PORT() macros instead.

ADDRESS_MAP_EXTERN() now is required to specify the number of 
databits, just like ADDRESS_MAP_START.

Removed ADDRESS_MAP_FLAGS() grossness. There are now three new macros
which replace its former usage. ADDRESS_MAP_GLOBAL_MASK(mask)
specifies a global address-space-wide mask on all addresses. Useful
for cases where one or more address lines simply are not used at
all. And ADDRESS_MAP_UNMAP_LOW/HIGH specifies the behavior of
unmapped reads (do they come back as 0 or ~0).

Changed internal memory mapping behavior to keep only a single
address map and store the byte-adjusted values next in the address
map entries rather than maintaining two separate maps. Many other
small internal changes/cleanups.
2008-03-09 21:59:57 +00:00
Zsolt Vasvari
ac9778cdb0 Changes first argument of video_screen_* functions to take a device_config
All callers that used 0 for the screen number now use machine->primary_screen
As a gap meassure, Where necessary, create a parallel set of video_screen_*_scrnum functions that take scrnum
All callers that specified a specific screen number now call the *_scrnum versions
Changed game info screen and overlay UI to display the screen tag instead of screen number
2008-03-09 15:41:17 +00:00
Zsolt Vasvari
d0870c6936 Moves 'refresh' from public to internal video state and renames it to 'frame_period'
Changes all drivers that previously accessed 'refresh' to use video_screen_get_frame_period()
2008-03-07 14:34:04 +00:00
Aaron Giles
fb26ec7c01 Cleanups and version bump. 2008-03-06 07:31:20 +00:00
Aaron Giles
ee0a5642ab Added running_machine * parameter to the front of all read/write handlers.
Updated all call-through handlers appropriately. Renamed read8_handler to
read8_machine_func, replicating this pattern throughout. 

Defined new set of memory handler functions which are similar but which
pass a const device_config * in place of the running_machine *. These are
called read8_device_func, etc. Added macros READ8_DEVICE_HANDLER() for
specifying functions of this type. Note that some plumbing still needs to
happen in memory.c before this will work.

This check-in should remove the need for the global Machine and in turn
"deprecat.h" for a lot of drivers, but that work has not been done. On
the flip side, some new accesses to the global Machine were added in the
emu/ files. These should be addressed over time, but are smaller in
number than the references in the driver.
2008-03-05 07:45:34 +00:00
Couriersud
492612b6c9 Various clean ups:
* remove more unreachable code
* identify more functions not being used
* Changed a number of global functions to being static
2008-03-01 16:54:52 +00:00
Aaron Giles
109bb332f0 The term "driver" is way overloaded in the system.
machine->drv is now machine->config.
Sorry.
2008-02-18 06:08:39 +00:00
Aaron Giles
abdb58671b Split timer_adjust() into timer_adjust_oneshot() and timer_adjust_periodic().
Updated all call sites.
Fixed recent build breaks.
2008-02-06 15:33:04 +00:00
Aaron Giles
444d77b838 From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] Fix C4305 warnings, other MSVC tweaks

Hi mamedev,

This patch is a bit of a potpourri.  It is the result of enabling most
of the suppressed warnings when using MSVC compilers and seeing what
issues arose with different compilers (I used 70,71,80,90).  Two of
the warnings were judged to be useful to enable and methodically fix.
Some issues spotted by the other warnings were also fixed.

1. Fixed issues flagged by MSVC warning C4305 (type truncation).
Almost all of these are harmless double->float narrowing in
initializers, but one warning spotlighted a bug in segasyse.c, where
code to use a higher sprite number had no effect due to the
insufficient range of UINT8.
2. Removed /wd4550 for VS7/VS71 compilers (expression evaluates to a
function which is missing an argument list).  There are no cases of
this warning currently, and if there were they would most certainly be
bugs.  This also allowed the warning suppression lists to be remerged
for VS7 and VS2005.
3. Decoupled intrinsic support decisions from PTR64 in eivc.h.
4. Fixed some VS7-specific issues (OPTIMIZE=0 at least compiles now).
That compiler doesn't support "long long" or "ll" (rsp.c/dkong.c).
5. Added a missing case statement in sm8500d.c.  Noticed while
reviewing dead code warnings.
6. Replaced a number of static constants with an enum in sidenvel.h.
This is unrelated to the rest of this patch, but it was overdue to be
done.
2008-01-24 14:24:59 +00:00
Zsolt Vasvari
f7c5c67e2e First in a series of updates to remove the use of the global Machine from as many places as possible 2008-01-24 09:12:03 +00:00
Aaron Giles
806a3de01c Made detection of dynamic attempts to install ROM/RAM handlers more aggressive.
Previous checks would not catch modifications in DRIVER_INIT or MACHINE_START calls.
Also changed one of the cheat calls back to using more generic switch detection so they can be triggered via joysticks.
2008-01-18 19:34:54 +00:00
Aaron Giles
a62870621a It's the end of uitext.c as we know it (and I feel fine) 2008-01-12 03:32:30 +00:00
Aaron Giles
ee9f88963c Copyright cleanup:
- removed years from copyright notices
 - removed redundant (c) from copyright notices
 - updated "the MAME Team" to be "Nicola Salmoria and the MAME Team"
2008-01-06 00:47:40 +00:00
Aaron Giles
ba9782dcec Added new function input_poll_keyboard_switches to poll for only key events.
Expanded the size of the maximum simultaneously pressed switches.
Should fix editableui0120u4red and cheat0118red.
2008-01-04 17:51:33 +00:00
Aaron Giles
507ca2d275 Changes for MAME 0.121u4. 2007-12-17 16:41:39 +00:00
Aaron Giles
c82a966b3b Changes for MAME 0.121u2. 2007-12-17 16:37:57 +00:00
Aaron Giles
7b77f12186 Initial checkin of MAME 0.121. 2007-12-17 15:19:59 +00:00