Commit Graph

197 Commits

Author SHA1 Message Date
negativeExponent
4ed6ed2443 libretro.c: Change indents from tabs to spaces 2020-02-29 09:48:09 +08:00
negativeExponent
a53e7ace23 Move overscan after rendering the NTSC frame, add ntsc scanlines
- do overscan cropping after the ntsc frame is generated. this allows
removing left and right screen artifacts when using horizontal crop like
what you would see happen in TV when adjusting horizontal size (HSIZE).

- add core option that implements NTSC scanline effects. This requires
framebuffer to double the height, so a define is added (NTSC_SCANLINES at
the top of libretro.c) to disable this on some low-memory platforms or just disable NTSC filters altogether.

- some minor cleanups
2020-02-29 09:35:18 +08:00
negativeExponent
fa74a364de Fix colour emphasis support for NTSC filter & raw palette + nes decoder shader
- this implementation is based on a more accurate colour emphasis from fceux.

- The raw palette + nes decoder shader was kinda incomplete since the implementation was based on
a per-frame basis which means that the emphasis bits were read once and applied to the whole frame. This
means that some games that uses a per pixel or per scanline emphasis would not appear correct. The more
accurate implementation reads emphasis bits from bits 5-7 of PPU[1] and saves this info in a separate frame.

- The same implementation is also used to fix emphasis for the ntsc filter.
2020-02-25 21:05:47 +08:00
negativeExponent
4f599a77f9 NtscFilter: Fix palette for VS. System games and cleanup
- fix palette for vs. system
- move most of the ntsc filter code to its own branch
- use fixed value for ntsc width and when its cropped
2020-02-25 09:39:37 +08:00
negativeExponent
695405ce56 Fix colour emphasis when using palette presets
This is an issue i found when implementing the NTSC filters. Currently when using palette presets,
no clour emphasis is seen on games that supports it. This is cause because the palette table is
fille with the same 64*3 colour info.

Using custom palette (palette file) and default both creates the emphasis as expected. So internally,
fceumm is able to support such feature.

The fix is to generate the base palette (64 * 3 with each triplet representing rgb colour), and then
send this internally using FCEUI_SetPaletteArray() to fill the colour table with emphasis instead.
2020-02-25 07:13:42 +08:00
negativeExponent
266bc3b92f Implement blargg ntsc filters
- this implements blargg's nes ntsc filters using core options
- an optional height doubling is also added but disabled for performance reasons (might make that optional as a core option)
- since PS2 and PSP have their own blitter branches, these platforms do not have the ntsc filters since i dont have the means to test on those systems.
- compile with HAVE_NTSC=1 to have these options, HAVE_NTSC=0 disabled filter including core options
- HAVE_NTSC=1 is set as default, other than PS2 and PSP as stated above.
2020-02-23 20:05:12 +08:00
negativeExponent
f9fb33d8e8 Silence warnings and fixes
- Silence warning [-Wmaybe-uninitialized]
- m359: Fix value overflow
- m534: Silence warnings
- mmc1: Silence warnings
- Silence more warnings
2020-02-17 10:30:42 +08:00
twinaphex
81058f3558 C89 build fixes 2020-02-16 19:34:14 +01:00
negativeExponent
bbce95d5aa Add prg and chr checksums and rearrange rom info logs 2020-02-16 21:54:21 +08:00
negativeExponent
1c94704512 Minimize core options shown by default
- This creates 2 new advance core options to minimize the number of core options shown
-- Advance System Options contains:
--- Overclock
--- RAM power on state
--- no-sprite limit
--- simultaneous opposing direction press
--- zapper crosshairs
-- Advance Sound Options contains:
--- Master volume
--- Sound quality
--- on/off for NES' 5-channel apu
- This also re-arranges the core options when advance options are shown, system options on top,
  gfx/palette/geometry options next, input etc.
2020-02-15 11:23:07 +08:00
negativeExponent
fa7b15eb61 Update region overrides and overclocking
- ines.c - misc cleanups
- Fix Dendy not restored when changing overrides back to auto mode
- directly apply new scanlines and additional scanlines when changing overclock settings
- (readability) change variable name overlock_state to overclock_enabled
2020-02-07 20:50:25 +08:00
negativeExponent
dc85a40951 Buildfix
- use shorter strings for state names
- make variables static
- turn C++ comments to C comments
- cleanup dead code in boards
2020-01-24 19:57:24 +08:00
twinaphex
58030a374d VLAs not supported in C89 2019-12-11 16:46:06 +01:00
Joseph C. Osborn
dbcfcc574a Put back some formatting 2019-11-06 16:06:09 -08:00
Joseph C. Osborn
112be4b57e Memory map some PPU buffers with 1 << 31 mask
Except 4 PPU register bytes starting at $2000
2019-11-06 16:02:50 -08:00
retro-wertz
8446a7ba58 dipswitch.c: Rename src and header file
- (non function-changing update) just for consistency, append "libretro_" to source file to be consistent with new core option file
2019-07-21 10:27:26 +08:00
retro-wertz
be1d0a3dac diswitch.c: Fix crash issues and and cleanup
- Partial rewrite to clean up dipswitch struct to prevent potential crashes
- Fix problems on vs games without dipswitch to cause core to crash
- Create dipswitch struct based on new core options layout
2019-07-21 09:57:03 +08:00
retro-wertz
3659603d19 Add core option sublabels 2019-07-20 01:24:08 +08:00
twinaphex
dae081ba6d Implement new environment callback RETRO_ENVIRONMENT_GET_INPUT_BITMASKS 2019-06-21 11:21:46 +02:00
Yoshi Sugawara
38ba67413f Add back support for pointer device (touchscreen) for lightgun input 2019-06-10 17:16:00 -10:00
retro-wertz
e654ed305c vsuni: simplify game database and other fixes
- simplify game database
- remove pre-configured core options. they are now created on a per-game basis on rom load.
- some minor data type changes
2019-05-22 20:32:50 +08:00
retro-wertz
16b689f7e0 Fix other input types not working on startup when type is set to auto 2019-05-18 22:39:23 +08:00
retro-wertz
f9aa5e5462 Add dipswitch for VS games and Mapper105 (NWC) 2019-05-18 22:38:41 +08:00
retro-wertz
d164ea7470 Move some startup variables into retro_load_game 2019-03-11 15:39:57 +08:00
retro-wertz
75e837f34a Update libretro.c 2019-02-24 01:51:44 +08:00
Francisco Javier Trujillo Mata
e962d1f19c [PS2] Fix wrong palette in FCEUmm 2019-02-22 00:05:24 +01:00
Francisco Javier Trujillo Mata
9715f13bc7 Improvement paddings
Improvement palette
2019-02-17 23:23:12 +01:00
Francisco Javier Trujillo Mata
d7f7709a37 Add palette into FCEumm for PS2 2019-02-01 23:39:18 +01:00
retro-wertz
b53fb91239 FDS: Use retro_get_memory_data/size for disk saving 2019-01-04 17:13:09 +08:00
retro-wertz
b6c251b7b2 Cleanup (#248)
* Silence some clang warnings

* Cleanup input and turbo functions

* Update apu pulse' swap duty cycle
2018-12-23 08:46:17 -06:00
retro-wertz
b09a060ae6 Wii related updates for save state fixes/workarounds (#246)
* Wii: Fix uninitialized save state size causing load state problems

- Issue origially from Wii and possibly affects similar devices where
retroarch and the core are one program. The problem was that the
serialize size was not reset when you change game, causing the last
serialized size to be carried over to the next game loaded causing save
state issues due to change in size. Initializing this variable during
retro_init() seems enough for most of the games.

- In this same observation, also initialized some variables in a similar
way.

- also exluded a variable used for sound state that was added for smooth
sound after load state which causes similar loading issues as well.

- default sample rate has been lowered to 32K as well as to minimize
some stuttering for these devices, while maintaining 48K sample rate for
others.

- Some comments are added to modified section as necessary.

* Add workaround for save state issue in Wii with expansion audio

- Some mappers are not loading states as well. Seems to affect those
that are using expansion audio. some of these mappers(bandai, mmc5,
namco106), the state variables has to be expanded so that it will
load states fine with big endian while others (vrc6, vrc7 sunsoft), some
variables that were added for smoother audio during load state has been
removed.

- This does not guarantee though that other mappers might not have
similar incompatibilities after loading a state but so far, some of the
most common roms in each mapper has been tested to load fine.

* FDS: Expand state variables for big endian compatibility

* FDS: Change OSD label from Disk 0 to Disk 1... when switching disks

- Minor osd label change that now shows Disk 1 of (# of disks) instead
of just Disk 0 Side nth.
2018-12-14 20:23:43 -06:00
retro-wertz
34985a9d6e Set max_width and max_height to its actual NES values
Fix crash while using video filters and video dimensions is changed
for example when using the overscan options.
2018-12-05 16:05:55 +08:00
Tatsuya79
b238ca5d62 Update libretro.c 2018-12-04 11:27:54 +01:00
retro-wertz
b5803e0e1d c89 compliant? (#237)
* Replace C++ comments into  C comments

* Move INLINE out of Makefile.common, move to fceu-types.h

An INLINE define is still existing in Makefile.common for msvc (dont
have a way to to test that). Moved the rest into fceu-types.h using the
one already existing from emu2413.h.

* Increase maximum volume for apu channels
2018-12-03 20:25:17 -06:00
retro-wertz
829a7552f1 Audiostuff (#236)
* Add option to enable/disable audio channels

Audio options are backports from FCEUX. Options are set as on/off toggle for each apu channel.

Compile with DEBUG=1 to see options.

* Add missing audio state vars, fix for hq audio when using runahead

* Additional checks for save ram (battery)

* Cleanup

* Update libretro header
2018-11-29 19:22:36 -06:00
retro-wertz
9d9c48007d Add core option: RAM power up state 2018-11-25 21:45:52 +08:00
retro-wertz
3cd1ea0060 palette:Labeling and index changes 2018-11-25 09:01:21 +08:00
retro-wertz
3de40d9126 Fix autodetection of NES controllers
Closes https://github.com/libretro/libretro-fceumm/issues/230
2018-11-23 07:25:17 +08:00
retro-wertz
53b7fc4ae7 Remove leftover lines 2018-11-23 02:18:16 +08:00
retro-wertz
b929147612 Update input settings, allow multi-player without matching CRC 2018-11-23 02:01:42 +08:00
David Walters
a9f1ef274b Use lightgun API for Zapper. 2018-09-27 08:43:12 +01:00
retro-wertz
1811ea1e06 Remove incomplete Use NTSC core option
Use NTSC colors option is incomplete due to missing int,hue adjustments. This can be added but there is no smooth way using core options or hotkey to selec ranges 1-256 for fine tuning

Using shaders instead can work better at this with more adjustments possible
2018-06-15 10:59:25 +08:00
SapphireTactician
9991455b69 Improve Label Redux Act 2
Changing name wording from what FCEUX used to @fr500 's suggestion
2018-04-17 23:17:12 -04:00
SapphireTactician
e5b3025d24 Update option title
Done as per @twinaphex
2018-04-14 18:50:29 -04:00
twinaphex
674be2d5d0 Add label 2018-04-14 19:49:14 +02:00
twinaphex
3f7127a932 Add up/down allowed core option 2018-04-14 19:35:51 +02:00
retro-wertz
1bcbfba6a6 Update to 4:3 aspect
Update 4:3 aspect so that image is not stretched when horizontal and vertical overscans are adjusted
2018-01-10 11:39:36 +08:00
retro-wertz
fe04e86c42 Cleanup input
Gamepad loops based on # of players(4 max), while other inputs are looped by number of ports(2 max).
2018-01-03 20:06:13 +08:00
retro-wertz
bec41ab460 Remove use of RETRO_ENVIRONMENT_GET_CURRENT_SOFTWARE_FRAMEBUFFER 2017-12-21 14:45:02 +08:00
twinaphex
6f8934aee7 Look in system header dir 2017-12-16 18:41:41 +01:00