Commit graph

82 commits

Author SHA1 Message Date
Jan Bujak 5a9d4ff5f2 Generate the palette lookup table at compile time 2023-11-27 23:30:02 +09:00
Jan Bujak 33fed82f68 Fix test suite compilation 2023-11-27 23:25:28 +09:00
Jan Bujak fb7c91a1c4 Reduce stack usage in hard_reset 2023-11-27 23:13:03 +09:00
Jan Bujak 1a557db886 Add soft float support 2023-11-03 22:34:47 +09:00
Jan Bujak e02a4b8b37 Support non-nightly no_std builds 2023-10-20 15:12:47 +09:00
Jan Bujak 71fcdf7b39 Get rid of the warnings when compiling without the log feature 2023-10-20 14:57:41 +09:00
Jan Bujak 8ebc612a53 Allow for the state to be const initialized 2023-10-20 14:56:29 +09:00
Jan Bujak af8ce41088 Remove unnecessary transmute 2023-09-30 21:12:15 +09:00
Jan Bujak 300a3024b9 Support playing back recordings in the devui
This is somewhat inaccurate and will desynch quickly though.
2023-09-30 20:12:00 +09:00
Jan Bujak c347a5d554 Remove redundant imports 2023-09-30 18:21:00 +09:00
Jan Bujak 32cbcbe91b Update phantom2c02 2023-09-30 18:18:37 +09:00
Jan Bujak 08845942ac Update bitflags to 2.4.0 2023-09-01 23:06:08 +09:00
Jan Bujak 82b588a540 Fix warnings 2023-09-01 22:58:28 +09:00
Jan Bujak 8eeacc5b88 Try to build Palette object in-place on the stack 2023-09-01 22:48:09 +09:00
Jan Bujak 609e9a4675 Regenerate rp2c02_testsuite 2023-03-12 01:24:47 +09:00
Jan Bujak 5e44a3ffc6 Sort the tests in rp2c02-testsuite by name 2023-03-12 01:24:20 +09:00
Jan Bujak 59c2a652db Add workspace and #[no_std] support 2023-03-12 01:21:05 +09:00
Jan Bujak 17c51a1e96 Fix AxROM initialization 2018-11-24 23:44:43 +01:00
Jan Bujak 583bc9f4fc Update README 2018-11-24 23:29:48 +01:00
Jan Bujak 4770dfc393 Add support for AxROM (mapper 7) 2018-11-24 23:28:46 +01:00
Jan Bujak 9a8174a1f8 Add initial (inaccurate) support for emphasis flags 2018-11-24 23:26:25 +01:00
Jan Bujak 3767d29163 pinky-web: Fix custom ROM selection 2018-08-27 17:35:37 +02:00
Jan Bujak 77b6fa368f Add support for UNROM 512 (mapper 30) 2018-08-26 00:30:50 +02:00
Jan Bujak 43f68f0b3b Extern the generic mapper 2018-08-26 00:29:04 +02:00
Jan Bujak 4aa2e0bed8 pinky-web: Update to stdweb 0.4 2018-06-24 22:16:29 +02:00
Louis Pilfold 61cd235e99 Fix a typo in README (#7) 2018-03-11 20:41:41 +01:00
Jan Bujak 1a25cf2cb1 pinky-web: Update README 2018-02-12 21:24:55 +01:00
Jan Bujak 3b8346f4f4 pinky-web: Set default target to wasm32-unknown-unknown 2018-02-12 21:22:12 +01:00
tragicmuffin b5b1e332c0 Fix silencing of noise channel when envelope decay is on
The noise channel is silent any time the envelope decay bit (i.e. bit 4 of $400C) is set to 0.

When bit 4 is 0, the envelope decay is disabled, so `is_manually_controlled` is set to false, and thus the volume of the noise channel gets set to `self.generated_volume` in VolumeGenerator's `volume()` function.
The problem is, `self.generated_volume` is never updated, and so it stays at the default volume of 0, silencing the channel.

As far as I can tell, the noise channel is supposed to work exactly the same as the square channels when it comes to the volume register, so my proposed fix is to duplicate the function used to update the square channels' volume generator, and update the noise channel along with the squares in `clock_sequencer()`.
2018-01-20 00:57:07 +01:00
tragicmuffin 96180c6bd2 Fixed silencing of square 1 channel when sweep is disabled
When the sweep is disabled, but the negate flag is set (%00001000 written to $4001), the `frequency_generator_output()` function shouldn't be called. In fact, because the last 3 bits are set to 0, the `adjust_period_based_on_frequency_generator()` function doesn't end up calling it.

But, it's being called to check if channel should be silenced:
`!self.enabled || self.period < 8 || self.length_counter == 0 || self.frequency_generator_output() >= 0x7FF`

When `frequency_generator_output()` is called here (with the sweep disabled), self.period is shifted by 0 bits, so period_delta = self.period.
Thus `self.period.wrapping_sub( period_delta ).wrapping_sub( 1 )` = (0-1), underflowing to 0xFFFF which is indeed greater than 0x7FF. So the channel is silenced.

Added an additional check to see if the sweep is enabled before checking its state.
2018-01-18 18:15:08 +01:00
chris 8afed2810a Fix JS TypeError when WebGL context is not defined.
This addresses cases where WebGL is either broken or disabled.  The
error message on Chrome was a Cannot read property 'create'Shader' of
null TypeError, however, the cause of this error was the variable `gl`
being null after attempting to retrieve all valid WebGL rendering contexts.
2018-01-08 17:08:17 +01:00
Jan Bujak 01534feeb3 Update README 2018-01-06 02:13:18 +01:00
Jan Bujak b8bc976acf pinky-web: Pixelate the canvas 2018-01-01 23:37:07 +01:00
Jan Bujak 971390fdad Update the controls 2018-01-01 20:38:17 +01:00
Jan Bujak 0bd8e1fabe Add pinky-web 2018-01-01 18:29:23 +01:00
Jan Bujak b915572ccc Add a few unofficial instructions 2017-12-31 15:42:50 +01:00
Jan Bujak 8489c6388a Extend CPU opcode generator to support multiple actions 2017-12-31 15:09:13 +01:00
Jan Bujak 7eb0b38e6f Export execute_cycle in nes interface 2017-12-31 14:09:20 +01:00
Jan Bujak 1cc4863609 Dynamically allocate the framebuffer to fix the stack overflow on wasm 2017-12-31 14:08:09 +01:00
Jan Bujak 6ed582f569 Update to newer sdl crate 2017-12-31 14:07:44 +01:00
Jan Bujak 6e3f57cdae Fix DMA tests compilation on new version of Rust 2017-03-24 21:14:11 +01:00
Jan Bujak 2d1d32ca8b Update to libretro-backend 0.2 2017-03-24 21:08:38 +01:00
Jan Bujak 675e6fc603 Do not draw sprites on the very first scanline. 2016-11-01 19:17:56 +01:00
Jan Bujak 3e6deb9e2d Properly support VROM-less games in generic mapper. 2016-11-01 19:13:51 +01:00
Jan Bujak ae1ae7438a Add a missing '..' in .travis.yml. 2016-11-01 16:53:50 +01:00
Jan Bujak 084b02761a Update README: UxROM support. 2016-11-01 16:49:07 +01:00
Jan Bujak dacd8400cc Add UxROM (2) support. 2016-11-01 16:48:10 +01:00
Jan Bujak 75b44ac90a Add a generic mapper; simplify ROM loading and mappers. 2016-11-01 16:43:06 +01:00
Jan Bujak 1dabac1997 Enable holy_diver_batman/M1_P128K_C128K_W8K test ROM. 2016-11-01 14:46:48 +01:00
Jan Bujak c99a2150cc Do not use hard_reset() for now since it doesn't reset the mapper. 2016-11-01 14:45:10 +01:00