Git Product home page Git Product logo

pce-devel / mednafenpcedev Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 5.0 10.2 MB

Managed Mednafen Git repo with relevant fixes in support of the PCE (Developer) Community.

Makefile 2.06% M4 0.69% Shell 0.36% C 57.84% Yacc 0.02% sed 0.01% C++ 31.20% Pascal 2.78% SourcePawn 0.14% PHP 0.04% CMake 0.01% POV-Ray SDL 2.80% HTML 0.01% Assembly 0.03% Pawn 1.60% NASL 0.39% Batchfile 0.01% BitBake 0.04%
pce tg16 supergrafx huc mednafen turbografx-16 pc-engine turbografx pcfx pc-fx

mednafenpcedev's People

Contributors

asiekierka avatar dshadoff avatar jbrandwood avatar pcedev16 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mednafenpcedev's Issues

BUG/Feature: Memory Base 128 does not seem to be supported

Memory Base 128 does not seem to be supported (tested on previous version - to be confirmed on this version).

This is supported by 23 games, and is required for several of them, in particular game by KOEI in the historical strategy genre.

Bug: PCE Module VCE doesn't render all of the Scanlines.

Currently the PCE Module doesn't allow you to see all of the scanlines.

When running with the following flags to attempt to view all of the available scanlines: mednafen -pce.slstart 0 -pce.slend 239 it will look as follows,
240pSuite-0005
Note the Bottom scanline number starting at 3 pixels before the line at the bottom becomes visible.

The desired behavior is as follows:
240pSuite-0004

Documentation: would be nice to have compile notes at the top level

I never know how to compile the package, and always felt that the included instructions weren't clear enough.

Now that this repo can be update by us, let's have some kind of top-level README instructions for compiling.
As a start, I found this page which actually gave me everything I needed to compile on linux:
http://jeremywininger.blogspot.com/2013/08/hey-lets-compile-mednafen-emulator.html

All I need to do was test and update settings.
(in particular, "sound.device" as per information here: https://mednafen.github.io/documentation/#Section_troubleshooting_nosoundlinux and here: https://mednafen.github.io/documentation/#sound.device )

Debug request: evaluate SAT/SATB values to "human-readable" forms

In the same way that various memory editors display memory values in byte/int16/int32/etc. forms, it would be nice to be able to see 8-byte groups of data which are Sprite Attribute Table data, as human-readable X/Y/pattern/attributes data.

In particular, I don't find the byte/int16/int32 representations useful; this could either be displayed alongside it, or it could be displayed in place of it (and as part of a selection "carousel" of different decodes, if there are other important ones).

Debugger request: Sprite "bounding box" display

In the same way that background layer and sprite layer can be turned on or off, it would be nice to be able to display the "bounding box" of sprites.

To a lesser degree, a "character grid" might also be useful.

BUG/Portions of the intro to Yuna 2 (Japanese) do not display due to oddities in video handling

This is believed to be a result of:

  - at the second rcr, sprites and bg are both disabled,
    forcibly blanking the remainder of the screen.
mednafen does not like having the lower bound of the crop set higher than
0xF2. this will result in the lower-bound crop triggering after the vsync
handler, which ends up disable bg for the entire screen.
this appears to just be an emulation bug, though.
using a lower value like 0xF0 instead will fix it regardless.

Debug request: VRAM video display should display/edit 16-bit words, not bytes.

VRAM video display should display/edit 16-bit words, not bytes.

This is especially problematic when using the address at the beginning of the line to understand the VRAM address.
Even if the memory display itself can't be altered to display/edit words, the addresses should reflect VRAM addresses rather than some some fictitious byte-based number.

Make Debugger opacity adjustment save to/load from mednafen.cfg file

Debugger opacity can be adjusted from within the debugger, using the '-' and '=' keys, but it is initially set to a fixed opacity which may be slightly too translucent for some users (like myself). This should be something which doesn't need to be adjusted each time it is run.

Bug: CD head seek time not implemented correctly

Several games require the implementation of variable head seek delays. In particular, the following games are known to have issues if the delay is too short (Mednafen's current delay may or may not be sufficient in each case below):

Brandish - ADPCM noise roughly 2.5 minutes into the initial cinema (when the sorceress is making a fireball)
Double Dragon II The Revenge - when you hit 'run', a voice should completely utter "Double Dragon" (but it is cut short)
Downtown Nekketsu Monogatari - when the speed is set to 'fast', and you leave the bookstore in the first town after exiting immediately, ADPCM continues speaking too many phrases (ADPCM end pointer not set properly)
F1 Team Simulation Project F - at startup, ADPCM noise shoartly after the horn honks

Many other games - significant desunchronization between the actual sound and the action (such as lip movement) . One of the more significant is "Mugen Senshi Valis"

Feature request - to display R/G/B colors on palette-view memory debugger screen

Memdebugger.cpp is a challenge, but it would be nice - one day, after 'word' visualization exists - to create a 'PCE palette' visualizer.

Today, the 'palette' memory screen displays a series of hexadecimal bytes on the left, and their ASCII representations on the right. Unused bits (above the 9-bits used for color) are ignored as inputs, and displayed as thought they were zero values.

In the immediate future, the hexadecimal display will be 16-bit words, but this still falls short of being easily-usable.

A more usable representation would be to change this to 3-digit octal - representing the 8 possible values for each of R,G,B - and simply not to display or input the unused bits. The R,G, and B values should be colored to indicate which value corresponds to R, G, and B respectively. On the right side, instead of an ASCII representation, there should be a simple square in the color represented by the RGB value.

This will be a fairly major change to the memdebugger.cpp file.

mednafen's emulation of PCE CD-ROM command $DE "read-toc" is faulty.

Mednafen is only returning 2-bytes for a type "0" read-toc, and 3-bytes for a type "1" read-toc.

Real PCE hardware returns 4-bytes for these commands, which is what the System Card requests.

The fix is simple. Line 219 in file "scsicd-pce-commands.inc" should be ...

case 0x0:
data_in[0] = U8_to_BCD(toc.first_track);
data_in[1] = U8_to_BCD(toc.last_track);
data_in[2] = 0;
data_in[3] = 0;

data_in_size = 4;
break;

case 0x1:
{
uint8 m, s, f;

LBA_to_AMSF(toc.tracks[100].lba, &m, &s, &f);

data_in[0] = U8_to_BCD(m);
data_in[1] = U8_to_BCD(s);
data_in[2] = U8_to_BCD(f);
data_in[3] = 0;

data_in_size = 4;

}

Feature request: Partial-screen render when debugging

When debugging, there is little-to-no visibility as to how the render of a frame of video is progressing, beyond register values. Actual frame render appears to only take place all at once, after a full frame is calculated.

Without changing the overall approach of rendering during a non-debug play session, it would be better to see the partially-rendered screen to be updated at each debug halt, ideally with an indicator of where the raster is at that point in the process (perhaps a dot which oscillates in color or something).

Investigate -qtRecord functionality and codec defaults

Currently the -qtrecord functionality has some areas for potential improvement.

The following items could allow for easier use of the resulting Quicktime media:

  • Switch -qtrecord to use the png codec as a default, allowing for direct support in 99% of NLE's without having to do any transcoding

  • Allow for user defined resolutions or 1:1 support. Currently the resolution is defined as follows, per the original authors intent:

"Conceptually, the video recording is done via the "ideal" video output from the emulation module, before any driver/frontend-side filters or scaling are applied.

The width is the least common multiple of the different possible horizontal resolutions on the emulated system, taking up the same physical space. For PCE, they are (nominally) 256, 341.33333..., and 512.

256 * 4 = 1024
341.33333.... * 3 = 1024
512 * 2 = 1024

The same idea is in place for PSX, though I admit 2720 is a bit...obscene. Wink

The height is treated similarly. PSX can be progressive/noninterlaced(Xx240), or interlaced(Xx480), so the least common multiple of the two is used, which
is 480.

It's done this way so as to not unnecessarily degrade video data(that and I'm not sure how to do a multiple-resolution video stream in QuickTime, and if it is possible, many video editing tools might not even accept it...).

The qtrecord.h_double_threshold and qtrecord.w_double_threshold settings control the dimensions below which the width and/or height are doubled; this doubling is why PCE is 1024x464 instead of 1024x232. It's more of a convenience feature, so that if you use an external video encoder to encode to a different format without fancy rescaling, the result won't be a blurry mess on playback. Beyond these settings, it's not possible to control the resolution of the outputted video recording via settings."

QtRecord Enh. Change default codec parameters to use PNG

Currently the codec default when recording the output of Mednafen with the QtRecord functionality is set to cscd, the CamStudio Screen Codec.

Switching the default codec to use PNG instead of cscd will allow for almost universal player support of the resulting Quicktime media as-is, without the need for any further transcoding to use the recorded QuickTime media for whatever intended purpose.

In simple testing, switching to using PNG has also resulted in a smaller file-size compared to the current cscd default codec. A timed 1 minute attract sequence of "Street Fighter II' Champion Edition" comes in at around 27MB with the current default cscd codec, and at only 7MB or so with the proposed PNG codec default.

Debug scaling improvements needed

We have discussed that 800x600 is not the ideal size for debug screens.

One of the results of that discussion was that they should perhaps be something more like 1024x768 in order to fit reasonably into a window on a 1920x1080 screen, or to be doubled on a 4K monitor.

The other is that we should be questioning whether the current approach to scaling the debug screen is "optimal" or not. Currently, debug scaling is determined by:

  1. Canvas size = (emulated picture dimensions) times (x- and y- scale factors from mednafen.cfg)
  2. Then, each possible debug panel (graphics, disassemble, memory, etc.) is scaled by the largest integer that will still fit inside of the canvas size.

So, for 320x240 screen, with x- and y- scale factors of 4, the total canvas size is 1280x960 ... and the 800x600 debug screen remains a 1x scale factor, with a huge border around it.

This is done because floating-point scaling factors would cause blurring of the text which is on these screens... but there is a middle-ground which might be more helpful: to be able to scale by halves as well as full integers (selectable of course). In this case, the debug screen would be able to be expanded by 1.5x scale, to 1200x600 within the 1280x960 canvas.

This half-integer scale may not always be desirable, but there should be an option.

Minor bug in 16-bit edit mode

In 16-bit word edit mode, if you start editing words in hex, then flip to ASCII, then edit only 1 character on the ASCII side, then flip back to the hex side, the cursor disappears and there can be some confusion over where the edit is taking place.

Develo system reports that unused bits in palette entries are high, not low

Need to validate whether palette entries' unused bits are:
a) low, as mednafen shows
b) high, as develo seems to indeicate, or
c) actually retained but unused

While editing of data may be easier if the unused bits are represented as zeroes, Mednafen should reproduce whatever is on real hardware for any programmatic reads (if it doesn't already do so ).

Emulation minor bug: PC Engine CD transfer rate doesn't match real hardware

@jbrandwood ran some tests on CDROM transfer rate, and determined that real hardware transfers at 150KB/s.

This has an impact on several things:

  1. HuVideo (and Sherlock Holmes) actually experiences a larger delay between fetches than is currently indicated by the seektime.c function(s). HuVideo provides enough buffering to make this invisible to the user.

  2. Current transfer rate (roughly 125KB/s) was apparently set due to the buffering system of Sherlock Holmes. In this case, the program seems to consume a sector once every 1/60th of a second, whereas they are supplied once every 1/75th of a second. We believe that a "sector buffer full" condition arises, requiring the CD to make a full revolution in order to pick up the overflow sector again, with the buffer having been emptied (or mostly emptied) in the meantime. However, the exact size of this buffer, and the timing of the rotation are not currently clearly-understood.

  3. Existing seektimes are set in some cases in order to avoid issues - particularly ADPCM overwrite issues. In some cases, the critical period consists of several { seek, read } tuplets, for an aggregate timing. Readjusting transfer rate to 150KB/s would reduce these periods to a degree that some of the issues might reappear, so testing and possible rebalance of seek times may be required.

Bug in FX backup memory implementation

I noticed that an item was overlooked while implementing the FX Backup memory changes.
In pcfx.cpp roughly line 625, there is a line to allocate/link the external backup memory using the "ASpace_Add" function, and one parameter is number of bits - it was originally 15, and was not updated to 17 at the time of update.

I will correct this once the 'happyeyes' code pull requests have been digested.

Feature request: Add "safe area" bounding box (configurable) within display, and a keyboard toggle

At the very least for debug reasons, there are times when every pixel which the machine is capable of rendering should be shown - even if traditional display would obscure them to varying degrees.

The implementation until now has been to create "visible portion" definitions, and simply not display anything which lies outside of that definition. This feature request is to make the entire normal hardware output to be visible, but to display a "bounding box" marking around the area defined to be visible. This way, it is more obvious what is clearly visible, partially obscured, and off-screen for a given viewing aperture.

BRAM unlock bit should be able to re-lock

Backup memory unlock bit (0x1807 bit 7) is set to unlock BRAM (i.e. set 0x1807 = 0x80).
Normally, BRAM is re-locked by reading 0x1803, but can also be locked by resetting bit of 0x1807 (i.e. same as above but the bit is reset).

PC-FX external memory is managed as only 32KB

External memory is configured and addressed as a "minimum viable solution", which does not match the actual hardware available.

Actual external FX-BMP cards hold 128KB of memory, but apparently the console can address substantially more (on a logical basis; the cartridge port is not yet understood understood well enough to make a cart beyond 128KB).

Mednafen should support greater than 32KB of external backup memory.

Bug: CPU <-> VRAM access wait states

There are wait states unaccounted for, in the CPU->VRAM interface.
Wonder Momo is a particular example of this; the same interrupt is used for both the raster interrupt and VBLANK; it assumes that is it on one or the other, based on the sequence, after initiated. The large block transfer into VRAM is one of few transactions which take place before the interrupt is set, so the result is that the wrong-sequenced interrupt is actually in place.

For proper wait-states, consult the implementation used in MiSTer (primarily VHDL):
https://github.com/MiSTer-devel/TurboGrafx16_MiSTer

Issue with MB128 implementation - error during loading

An odd error message can arise under certain circumstances, seeming to indicate that a game's expected 2KB '.sav' file could not be loaded because it was found to be 2KB and not 128KB (which seems like nonsense).

It happens under the following conditions (and is due to residual code form a copy-paste):

  • If the MB128 files has been created, and
  • if MB128 is enabled, and
  • if a non-MB128-using game has created a game-specific '.sav' file

BG bit not being evaluated properly

During active display portion, behaviour should be as follows:

  • If both Sprite display and background display bits are off at the latch point near beginning of screen display, then "burst mode" is set.
  • During burst mode, Sprite color 0 is shown for the whole screen
  • However, if sprite display is on and BG is off, then the active display portion of the screen should show BG color 0, and overscan should show sprite color 0. Medanfen gets this wrong and displays sprite color 0 in this case for both active display and overscan.

The attached test sets Sprite color 0 to green and background color to black.
LEFT / RIGHT sets/resets the sprite control bit, and up/down sets/resets the background bit.

PCE_bg_test.zip

Verify whether the VCE chroma bit affects number of lines per field

There is a bit on VCE which controls artifact visibility - one value reduces them for text legibility, and the other value enhances them for artistic presentation.

This flag modifies whether the VCE produces 262 or 263 lines per field, which in turn affects refresh frequency. While I am not aware of any games which rely on this behavior, it does affect things such as the MDFourier suite timing.

Bug - BRAM is not displayed in HuCard mode (PCE)

In PCE debugger, when running a HuCard image, the memory viewer "BRAM" panel does NOT show the same information as the "Physical Memory" area 1EE000 does.

This seems to be because there are two different ways of dealing with backup memory in Mednafen - one for CDROMs, and one for HuCards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.