(WIP) David Haywood's Homepage - 模擬器

By Anonymous
at 2015-12-07T21:54
at 2015-12-07T21:54
Table of Contents
2015.12.01
"Bubble Bubble"
In the comments of my update about Nostradamus an original reference video
for another game I’d emulated a long time ago was posted. That game was
Aquarium by Excellent System, the video was this one by YouTuber ‘zu4989’
The post was made in relation to an audio issue in the emulation, now, the
driver was done long before I really had any idea how to hook up audio chips,
so that side of thing was done by somebody else (R. Belmont from memory?) but
with a better understanding of these things myself now I decided to take a
look.
The basic issue was that the wrong music was being played at the wrong times.
Initially I thought it might be a simple case of a bad modernization, old
versions of MAME required you to leave a gap in the CPU region where you
loaded a ROM if RAM was present for 8-bit CPUs (Z80 etc.) Newer versions don’
t have this flaw and as a result a lot of drivers were cleaned up to remove
that hack and handle things properly, it looked on the surface like the rom
loading on Aquarium had been updated, but the modernized banking code was
pointing to the wrong places (it was looking for 7 banks of 0x8000 from an
offset of 0x18000 in the z80 region, which actually exceeded the size of the
region and could have potentially caused crashes if the final banks were
actually banked in)
However, even fixing that, the music did NOT match the reference videos
provided.
Looking more closely at the banking writes the game was making revealed a
little more, we were using the bottom 3 bits of the register, so writes of
0x00, 0x01, 0x02 … up to 0x07 would select different banks. What the game
was actually writing was 0x0, 0x1, 0x2, 0x3 and 0x10, 0x11, 0x12, 0x13,
nothing else. At this point it was clear that we were using the wrong banking
bits, the correct bits to use were the bottom 2 bits, and the 4th bit.
Each bank contains a difference piece of music, so by cross-referencing with
the video again I was able to establish which bank write related to each real
bank, and re-order the above bank select bits into the proper bank value (bit
0x01 -> 0x01, bit 0x10 -> 0x02, bit 0x02 -> 0x04) with that done, the music
was fixed. This scrambling isn’t too surprising, the driver already had a
descramble function for the OKI commands.
I’ve recorded a video of the game with the correct music being played,
(CHEATS ARE ENABLED TO MAKE DEMONSTRATING ALL THE LEVELS EASIER) You can
cross-reference it with the video linked above if you want
https://www.youtube.com/watch?feature=player_embedded&v=DVBO66HM3oM
The reference video also showed a number of cases where our priority handling
wasn’t correct, namely the top border should have been chopping the large
fish sprites and wasn’t, the large fish sprites also needed to go under the
insert coin text (already correct) but at the same time needed to be shown
above the bottom part of the NEXT text. Furthermore the smaller sprites
showing the next pieces to appear needed to go underneath the tilemap. All
those cases were fixed. The background colour was also incorrect, this wasn’
t really visible anywhere except on the Winners Don’t Use Drugs screen, but
I fixed that while I was at it as it was obvious even without a reference.
來源 http://mamedev.emulab.it/haze/
--
ポーラステーション
http://perry0517a.blogspot.tw/
--
"Bubble Bubble"
In the comments of my update about Nostradamus an original reference video
for another game I’d emulated a long time ago was posted. That game was
Aquarium by Excellent System, the video was this one by YouTuber ‘zu4989’
The post was made in relation to an audio issue in the emulation, now, the
driver was done long before I really had any idea how to hook up audio chips,
so that side of thing was done by somebody else (R. Belmont from memory?) but
with a better understanding of these things myself now I decided to take a
look.
The basic issue was that the wrong music was being played at the wrong times.
Initially I thought it might be a simple case of a bad modernization, old
versions of MAME required you to leave a gap in the CPU region where you
loaded a ROM if RAM was present for 8-bit CPUs (Z80 etc.) Newer versions don’
t have this flaw and as a result a lot of drivers were cleaned up to remove
that hack and handle things properly, it looked on the surface like the rom
loading on Aquarium had been updated, but the modernized banking code was
pointing to the wrong places (it was looking for 7 banks of 0x8000 from an
offset of 0x18000 in the z80 region, which actually exceeded the size of the
region and could have potentially caused crashes if the final banks were
actually banked in)
However, even fixing that, the music did NOT match the reference videos
provided.
Looking more closely at the banking writes the game was making revealed a
little more, we were using the bottom 3 bits of the register, so writes of
0x00, 0x01, 0x02 … up to 0x07 would select different banks. What the game
was actually writing was 0x0, 0x1, 0x2, 0x3 and 0x10, 0x11, 0x12, 0x13,
nothing else. At this point it was clear that we were using the wrong banking
bits, the correct bits to use were the bottom 2 bits, and the 4th bit.
Each bank contains a difference piece of music, so by cross-referencing with
the video again I was able to establish which bank write related to each real
bank, and re-order the above bank select bits into the proper bank value (bit
0x01 -> 0x01, bit 0x10 -> 0x02, bit 0x02 -> 0x04) with that done, the music
was fixed. This scrambling isn’t too surprising, the driver already had a
descramble function for the OKI commands.
I’ve recorded a video of the game with the correct music being played,
(CHEATS ARE ENABLED TO MAKE DEMONSTRATING ALL THE LEVELS EASIER) You can
cross-reference it with the video linked above if you want
https://www.youtube.com/watch?feature=player_embedded&v=DVBO66HM3oM
The reference video also showed a number of cases where our priority handling
wasn’t correct, namely the top border should have been chopping the large
fish sprites and wasn’t, the large fish sprites also needed to go under the
insert coin text (already correct) but at the same time needed to be shown
above the bottom part of the NEXT text. Furthermore the smaller sprites
showing the next pieces to appear needed to go underneath the tilemap. All
those cases were fixed. The background colour was also incorrect, this wasn’
t really visible anywhere except on the Winners Don’t Use Drugs screen, but
I fixed that while I was at it as it was obvious even without a reference.
來源 http://mamedev.emulab.it/haze/
--
ポーラステーション
http://perry0517a.blogspot.tw/
--
Tags:
模擬器
All Comments
Related Posts
玩MAME的好東西~~~

By Harry
at 2015-12-07T14:38
at 2015-12-07T14:38
ALUNDRA 夢的冒險 動作冒險解謎(PS平台)

By Daph Bay
at 2015-12-07T12:32
at 2015-12-07T12:32
大魔界村

By Una
at 2015-12-07T11:01
at 2015-12-07T11:01
MedGui Reborn 0.060

By Zenobia
at 2015-12-05T22:52
at 2015-12-05T22:52
Xebra/Arbex (2015/12/03)

By Enid
at 2015-12-05T22:40
at 2015-12-05T22:40