Commit Graph

32 Commits (master)

Author SHA1 Message Date
Michael Forney 415c110b28 games/gb: fix reversed audio channels
The high bits correspond to the left channel, and the low bits to the
right channel.

Reference: https://gbdev.io/pandocs/#sound-control-registers

Tested with pokemon crystal.
2021-02-08 04:58:49 +01:00
Michael Forney e502abe001 games/gb: various HDMA fixes
H-blank DMA should only transfer 16 bytes per h-blank, rather than
waiting for the first h-blank and then transferring the whole size.

HDMAC should read 0xff when the transfer is finished, and 0 in the
high bit when the transfer is ongoing. Also, if 0 is written in the
high bit, the current transfer should be aborted.

Introduce two flags, DMAREADY and DMAHBLANK rather than special
constants 1 and -1. If dma is non-zero, there is an ongoing DMA. If
DMAREADY is set, the next chunk is ready to transfer.

Reference: https://gbdev.io/pandocs/#ff55-hdma5-cgb-mode-only-new-dma-length-mode-start

Tested with pokemon crystal.

What was happening is that when the game was loading N background tiles
into vram (each 16 bytes, so one per h-blank), it did something like
this:
- start an hdma transfer for N+1 tiles
- after the Nth tile is transferred, it would read HDMA5, clear the
high bit, then write it back to abort the transfer.

games/gb would instead transfer all N+1 tiles at once, overwriting one
extra tile with whatever was 1 past the end of the source array, and
then would interpret the cancel request as the start of a new transfer
of 16 bytes, which would copy an additional tile past the end. The end
result is that every transfer would end up copying N+2 tiles instead
of just N, overwriting certain tiles with whatever was after the end
of the source data.
2021-02-08 04:58:41 +01:00
Michael Forney 655170c873 games/gb: fix timer divider for input clock 0
According to [0], input clock 0 should divide by 1024=2¹⁰, not 2¹².
This caused audio to run at quarter-speed in one game I tried.

[0] https://gbdev.io/pandocs/#ff07-tac-timer-control-r-w

Tested with zelda: oracle of seasons, and dr. mario
---
2021-02-08 04:58:02 +01:00
aiju 921b75a909 games/gb: when the LCD is turned off, reset ppuy and ppustate to 0, fixes bug in dragon warriors iii reported by mischief 2018-10-11 16:25:11 +00:00
qwx 09c6120444 emulators ui: add option for fixed factor scaling and bound scale vertically 2018-06-13 14:05:19 +02:00
aiju 9fbce3b1b4 games/gb: attempt at fixing sprite priority 2018-06-13 09:52:41 +00:00
aiju 5d202d3456 games/gb: fix mbc5 register addressing (fixes warioland3 gamebreaking bug) 2018-06-13 09:26:55 +00:00
qwx 88537cfe9b demote libemu to common code
- too small, nothing else that won't be under /games will use it
- "libemu" as a name doesn't make sense here
2018-05-13 07:01:47 +02:00
qwx 1195ca910c add libemu
move redundant code from emulators to a common library
2018-05-12 19:20:53 +02:00
qwx 7d18756b39 gb*: reverse savegame field polarity 2018-03-31 11:38:09 +02:00
qwx 84351ae4cb blit,c64,gb*: fix phaser coolant leak during resize 2018-03-31 11:37:25 +02:00
aiju d9a964788b games/gb: fix bug that prevented timer data from being accessed (thanks qwx) 2017-02-12 12:28:02 +01:00
aiju fe1e95d6d8 games/gb: timer array should be unsigned (thanks qwx) 2017-02-12 00:38:17 +01:00
aiju 6176b55759 games/gb: fix typo in the routine to load timer data (thanks qwx) 2017-02-11 23:52:35 +01:00
cinap_lenrek ce84082205 change /dev/kbd to return multiple messages per read 2016-04-03 22:54:22 +02:00
aiju e8221d07d8 games/gb: improve sound emulation by modelling analog behaviour 2015-04-12 14:55:25 +02:00
aiju 2a1d369281 games/gb: limit audio range to prevent clipping 2015-04-11 16:07:15 +02:00
aiju d9af840ca2 games/gb: improved audio code 2015-04-02 15:30:12 +02:00
aiju 52ab0d1534 games/gb: fix gbc dma 2015-04-01 19:27:52 +02:00
aiju 66c98fab71 games/gb: fix -2/-3 2015-04-01 19:02:03 +02:00
aiju edfdc4ac07 new games/gb: better emulation and gbc support 2015-04-01 16:17:17 +02:00
glenda 67eb30f0ca games/gb: better video scaler from games/nes 2014-03-30 22:18:17 +01:00
aiju ff5ac0c5cb games/nes: improved time synchronization
games/gb: added some games/nes improvements
2014-02-27 19:52:02 +01:00
qeed 5dc9c7f443 fixed operand size for ADD SP, n 2013-05-02 10:40:45 -04:00
aiju 69f5a04ac3 games/gb: del instead of f12/o 2012-08-25 22:38:32 +02:00
aiju 9cab16b426 games/gb: set audioproc priority 2012-08-25 22:33:51 +02:00
aiju d7c21149e4 gb: pause function 2012-08-25 22:13:29 +02:00
aiju 83e3b1ce1a games/gb: crash and audio fix 2012-04-14 20:53:42 +02:00
aiju d7f507b5b9 games/gb: better audio, scaling, fixed serious MMC5 bug 2012-04-07 16:03:16 +02:00
aiju 8ebb846fb2 more games/gb fun 2012-04-06 20:57:45 +02:00
aiju 4950b5468b various games/gb improvements 2012-04-06 23:29:37 +02:00
aiju e9854eb12b added gb emulator prototype 2012-04-05 19:11:26 +02:00