Game Doctor disks with FDSLoader

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

Post Reply
NewRisingSun
Posts: 1027
Joined: Thu May 19, 2005 11:30 am

Game Doctor disks with FDSLoader

Post by NewRisingSun » Tue Jul 03, 2018 10:42 am

FDSLoader currently does not dump certain Game Doctor copier disks except in raw mode. The reason is that some of them fill the file header fields with nonsense, presumably as a protection measure against unaware copy utilities. Attached document written by me covers various aspects of Famicom copier hardware; Section 1.2.3 is the one relevant for dumping and image parsing purposes.
Attachments
Copier.txt
(30.51 KiB) Downloaded 186 times

Tomy
Posts: 51
Joined: Sat May 06, 2006 9:19 am
Contact:

Re: Game Doctor disks with FDSLoader

Post by Tomy » Wed Aug 08, 2018 3:04 am

Thank you very much for this valuable document. I own Game Converter 1M from beginning. At last, I own Game Master and Doctor 6+. I helped Venus dump game for their copier. But they don't give any document to me. So, your document is the best I ever seen. Although, now have better flash cart than old copier. But FC copier give me a happy child time. Thanks.

Tomy
Posts: 51
Joined: Sat May 06, 2006 9:19 am
Contact:

Re: Game Doctor disks with FDSLoader

Post by Tomy » Wed Aug 08, 2018 3:13 am

Doctor 6+ use CPU Cycle Counter. Do you have good routine to convert Line Counter to CPU Cycle Counter ? I saw Venus have one, but seems it is not very well. Thanks.

NewRisingSun
Posts: 1027
Joined: Thu May 19, 2005 11:30 am

Re: Game Doctor disks with FDSLoader

Post by NewRisingSun » Wed Aug 08, 2018 10:56 am

The one used in Rockman 3 seems to be good --- the IRQs are reproduced very similar to the original MMC3 cartridge. First, initialize a table:

Code: Select all

	LDY	#0
	STY	$7200
	STY	$7300
	STY	$00
	STY	$01
	INY
.L1:	CLC
	LDA	$00
	ADC	#$72
	STA	$00
	LDA	$01
	ADC	#$00
	STA	$01
	LDA	$00
	STA	$7200,Y
	LDA	$01
	STA	$7300,Y
	INY
	BNE	.L1
Then, reset and start the counter at the start of the NMI handler:

Code: Select all

	LSR	$440C   ; clear counting flag and reset the counter
	LDA	#$FF     ; set counting flag again to restart the counter, make it count longer than a frame so it will be reset by next NMI before it occurs
	STA	$440C
	STA	$440D
Whenever you would write a scanline value to the MMC3's IRQ latch, use the following:

Code: Select all

	; A: Absolute scanline number where IRQ shall occur
	TAX
	LDA	$7200,X
	STA	IRQCount_LSB
	LDA	$7300,X
	STA	IRQCount_MSB
	LDA	IRQCount_LSB
	STA	$440D
	LDA	IRQCount_MSB
	CLC
	ADC	#$08	; Add 2048 cycles for VBlank duration
	ORA	#$80	; Set counter enable flag
	STA	$440C
Code copied from K127 (Rockman 3). The calculation will be a bit off because it uses 114 cycles per scanline; correct would 113+2/3. To accomodate that, you would only have to improve the table generation by slightly unrolling the loop:

Code: Select all

	LDY	#0
	STY	$7200
	STY	$7300
	STY	$00
	STY	$01
	INY
.L1:	CLC
	LDA	$00
	ADC	#$71 ; 113
	STA	$00
	LDA	$01
	ADC	#$00
	STA	$01
	LDA	$00
	STA	$7200,Y
	LDA	$01
	STA	$7300,Y
	INY
	BEQ	.done
.L2:	CLC
	LDA	$00
	ADC	#$72 ; 114
	STA	$00
	LDA	$01
	ADC	#$00
	STA	$01
	LDA	$00
	STA	$7200,Y
	LDA	$01
	STA	$7300,Y
	INY
	BEQ	.done
.L13	CLC
	LDA	$00
	ADC	#$72 ; 114
	STA	$00
	LDA	$01
	ADC	#$00
	STA	$01
	LDA	$00
	STA	$7200,Y
	LDA	$01
	STA	$7300,Y
	INY
	BNE	.L1
.done:
Depending on where the counter reset occurs in your NMI handler, you might have to fine-tune the $0800 bias that is added to IRQCount_LSB/MSB.

Tomy
Posts: 51
Joined: Sat May 06, 2006 9:19 am
Contact:

Re: Game Doctor disks with FDSLoader

Post by Tomy » Wed Aug 08, 2018 7:12 pm

Thanks for your help. I have two more question. Hope you know the answer.

1) 6000-7FFF is save area for RPG games. But most games (need mapper) will use 7000-71FF to store some routines. Then, when the game need save data, it will damage the routines. Is there any other location can use to store these routines ? (doctor 6+)

2) Can Doctor 6+ emulate MMC2 (like Mike Tyson) ?

Thank you.

NewRisingSun
Posts: 1027
Joined: Thu May 19, 2005 11:30 am

Re: Game Doctor disks with FDSLoader

Post by NewRisingSun » Wed Aug 08, 2018 10:26 pm

1. The routines at $7000-$71FF will relocate themselves to an unused area with the $6000-$7FFF for games that would overwrite parts of that area. Ganbare Goemon Gaiden 1 is such an example. Apparently, some Super MagiCard games put their trainers in the $5xxx area, but I've never seen a (Super/Turbo) Game Doctor game do that.
2. Not that I know of. Emulating the MMC2 is quite involved: It requires snooping the PPU bus for specific address patterns and automatically bankswitching based on that. I don't think that information was available in 1987-1990, and even if it was, it would only be good for one or two games (Mike Tyson and Famicom Wars, as the Fire Emblem games were published later).

Tomy
Posts: 51
Joined: Sat May 06, 2006 9:19 am
Contact:

Re: Game Doctor disks with FDSLoader

Post by Tomy » Thu Aug 09, 2018 1:21 am

I see. Thank you for your information about Doctor 6+.

Post Reply