カテゴリ 重要度 ステータス 解決状況 登録日時 最終更新
DIP/入力解決済み実機のバグ2008-02-20 00:432008-02-20 00:43
 
テスター-Misc Reporters-担当者stephhソースsnk/mainsnk.cpp
バージョンN/A発生バージョン修正バージョン
修正コミットプルリク
フラグ
セット madcrash
セット詳細
madcrash - マッドクラッシャー
 
概 要BonusLifeのDIP設定と、そのOccuranceDIP設定がマッチしない。
詳 細The extra lives don't fit the "Bonus Life" Dip Switch when you set the "Occurence" Dip Switch to "1st, 2nd then every 2nd".
再現手順 
追加情報marvins.c merged into snk.c in 0.127u2

Read the text file for more info. "Basic" Z80 knowledge needed, sorry ;) - stephh

madcrash (marvins.c driver)

There is an ingame bug if you set the "Occurence" Dip Switch to "1st, 2nd then every 2nd" ...

Here are some useful addresses :

  - 0xc663-0xc666 : player score   (BCD coded, MSB first)
  - 0xc303-0xc306 : 1st bonus life (BCD coded, MSB first)
  - 0xc307-0xc30a : 2nd bonus life (BCD coded, MSB first)
  - 0xc670-0xc673 : next bonus life in case of more than 2 occurences (MSB first)


In fact, only these addresses interest us : 0xc663-0xc664, 0xc307-0xc308 and 0xc670-0xc671 ...

I assume that you've set the "Bonus Lives" Dip Switch to "20k, 60k" ...

When you start a game, here are the contents of the addresses :

  - 0xc663 = 0x00 and 0xc664 = 0x00
  - 0xc307 = 0x00 and 0xc308 = 0x06
  - 0xc670 = 0x00 and 0xc671 = 0x00

When you get your 1st life at 20000 points, this code is executed :

[BEGIN]
1300: 21 07 C3    ld   hl,$C307
1303: 11 70 C6    ld   de,$C670
1306: 01 04 00    ld   bc,$0004
1309: ED B0       ldir
[END]

So the contents of the addresses are now :

  - 0xc663 = 0x00 and 0xc664 = 0x02
  - 0xc307 = 0x00 and 0xc308 = 0x06
  - 0xc670 = 0x00 and 0xc671 = 0x06

But when your score reaches 60000 points, this code is executed :

[BEGIN]
1352: 11 0A C3    ld   de,$C30A
1355: 21 73 C6    ld   hl,$C673
1358: 06 04       ld   b,$04
135A: 37          scf
135B: 3F          ccf
135C: 1A          ld   a,(de)
135D: 1B          dec  de
135E: 8E          adc  a,(hl)
135F: 77          ld   (hl),a
1360: 2B          dec  hl
1361: 10 F9       djnz $135C
[END]

If you watch carefully, you'll notice that there is NO 'daa' ("decimal ajust", needed when you add/sub BCD numbers) after the 'adc  a,(hl)' at address 0x135e ...

So the contents of the addresses are now :

  - 0xc663 = 0x00 and 0xc664 = 0x06
  - 0xc307 = 0x00 and 0xc308 = 0x06
  - 0xc670 = 0x00 and 0xc671 = 0x0c  !!!

When your scores reaches 100000 points, 0xc663 = 0x00 and 0xc664 = 0x10 ...

And 0x0010 > 0x000c ... So you get ANOTHER life and the buggy routine is called again !

So the contents of the addresses are now :

  - 0xc663 = 0x00 and 0xc664 = 0x10
  - 0xc307 = 0x00 and 0xc308 = 0x06
  - 0xc670 = 0x00 and 0xc671 = 0x12  !!!

And this means that another life will be awarded when your score reaches 120000 points (0xc663 = 0x00 and 0xc664 = 0x12) !

I could continue for ever ;) I hope that you've understood everything ...
 
添付ファイル