Yes, that's how most emulators work, but the point is that this one game, Low G Man, will not work if it finds RAM at $6000-$7FFF. It's a rudimentary form of copy protection or something like that.Boolean wrote:For emulator CPU address $6000-7FFF, I decide to create one RAM no matter if it will be used.
About MMC3
Moderator: Moderators
Re: About MMC3
Re: About MMC3
The NES 2.0 header can tell you whether or not it has RAM, and how much, if it is less than 8K. Therefore you can tell if it is RAM or not. For older iNES headers, it could be chosen based on which mappers have PRG RAM, and/or to always put RAM if the battery bit is set, since that bit otherwise won't do anything; or you can require Low G Man to be converted to NES 2.0 headers before they will work.Boolean wrote:For emulator CPU address $6000-7FFF, I decide to create one RAM no matter if it will be used. If ROMs contain a battery, save RAM to file when game exit or load saved file (if any) to RAM when game launch.
[url=gopher://zzo38computer.org/].[/url]
Re: About MMC3
Does Low G Man write to the WRAM protection register? I know a lot of emulators that don't support NES 2.0 will ignore writes to the WRAM protection register so that they can support MMC6 games (StarTropics and StarTropics 2).
Re: About MMC3
Yes, but with a nonsensical value (0x01).tepples wrote:Does Low G Man write to the WRAM protection register?
At address $F43A (file offset 0x1f44a):
Code: Select all
ldx #$00
stx $2005
stx $2005
stx $E000
stx $4010
inx
stx $A000
lda #$0F
sta $4015
lda #$40
sta $4017
stx $A001
Re: About MMC3
Based on how I understand PRG RAM protection, that value isn't nonsensical. Any value in $00-$7F should disable the PRG RAM entirely. Emulators that don't respond are probably applying a hack to run StarTropics without CRCs and without NES 2.0.
Re: About MMC3
This is part of the power-on reset code. By proximity, there's no reason to have written 1 instead of 0 (or $15, or $40)...
But, in any case, Low G Man works correctly if I disable nestopia's hash and have it treat the game as TSROM instead of TLROM.
This is actually in Disch's notes.
But, in any case, Low G Man works correctly if I disable nestopia's hash and have it treat the game as TSROM instead of TLROM.
This is actually in Disch's notes.
Re: About MMC3
Sounds good.I should learn about NES 2.0zzo38 wrote:The NES 2.0 header can tell you whether or not it has RAM, and how much, if it is less than 8K. Therefore you can tell if it is RAM or not. For older iNES headers, it could be chosen based on which mappers have PRG RAM, and/or to always put RAM if the battery bit is set, since that bit otherwise won't do anything; or you can require Low G Man to be converted to NES 2.0 headers before they will work.Boolean wrote:For emulator CPU address $6000-7FFF, I decide to create one RAM no matter if it will be used. If ROMs contain a battery, save RAM to file when game exit or load saved file (if any) to RAM when game launch.
Re: About MMC3
Does the game write $6000-7FFF, then read and compare read value with written value?tokumaru wrote:Yes, that's how most emulators work, but the point is that this one game, Low G Man, will not work if it finds RAM at $6000-$7FFF. It's a rudimentary form of copy protection or something like that.Boolean wrote:For emulator CPU address $6000-7FFF, I decide to create one RAM no matter if it will be used.
Last edited by Boolean on Wed Feb 26, 2014 4:31 am, edited 1 time in total.
Re: About MMC3
1. What is the meaning of regexp '[\x8C-\x8E]\x01\xA0' ?lidnariq wrote:Yes, but with a nonsensical value (0x01).tepples wrote:Does Low G Man write to the WRAM protection register?
At address $F43A (file offset 0x1f44a):This is the only location in PRG that matches the regexp '[\x8C-\x8E]\x01\xA0'.Code: Select all
ldx #$00 stx $2005 stx $2005 stx $E000 stx $4010 inx stx $A000 lda #$0F sta $4015 lda #$40 sta $4017 stx $A001
2. This code only write $A001 with $01. Both bit 7 and bit 6 are 0, so write protection will not be triggered.
7 bit 0
---- ----
RWxx xxxx
||
|+-------- Write protection (0: allow writes; 1: deny writes)
+--------- Chip enable (0: disable chip; 1: enable chip)
Re: About MMC3
I understand question 2. Bit 7 is 0, chip is not available.Boolean wrote:1. What is the meaning of regexp '[\x8C-\x8E]\x01\xA0' ?lidnariq wrote:Yes, but with a nonsensical value (0x01).tepples wrote:Does Low G Man write to the WRAM protection register?
At address $F43A (file offset 0x1f44a):This is the only location in PRG that matches the regexp '[\x8C-\x8E]\x01\xA0'.Code: Select all
ldx #$00 stx $2005 stx $2005 stx $E000 stx $4010 inx stx $A000 lda #$0F sta $4015 lda #$40 sta $4017 stx $A001
2. This code only write $A001 with $01. Both bit 7 and bit 6 are 0, so write protection will not be triggered.
7 bit 0
---- ----
RWxx xxxx
||
|+-------- Write protection (0: allow writes; 1: deny writes)
+--------- Chip enable (0: disable chip; 1: enable chip)
- Jarhmander
- Formerly ~J-@D!~
- Posts: 521
- Joined: Sun Mar 12, 2006 12:36 am
- Location: Rive nord de Montréal
Re: About MMC3
regexp (or regex) is short for regular expression (Chinese). The [\x8C-\x8E]\x01\xA0 regex means, in english, "Match a byte that has a value from 0x8C to 0x8E that is followed by 0x01 and 0xA0". Regexes are normally used for text string search but they can be used to find a binary string.Boolean wrote:1. What is the meaning of regexp '[\x8C-\x8E]\x01\xA0' ?
((λ (x) (x x)) (λ (x) (x x)))
Re: About MMC3
Thank you.But it seems ...Jarhmander wrote:regexp (or regex) is short for regular expression (Chinese). The [\x8C-\x8E]\x01\xA0 regex means, in english, "Match a byte that has a value from 0x8C to 0x8E that is followed by 0x01 and 0xA0". Regexes are normally used for text string search but they can be used to find a binary string.Boolean wrote:1. What is the meaning of regexp '[\x8C-\x8E]\x01\xA0' ?
[\x8C-\x8E]\x01\xA0 stands for 0x8C 0x01 0xA0 or 0x8D 0x01 0xA0 or 0x8E 0x01 0xA0.
To MMC3, only stx $E000(x == 0), stx $A000(x == 1) and stx $A001(x == 1) instructions are useful.
What is the relation between [\x8C-\x8E]\x01\xA0 and the instructions?
Re: About MMC3
To the 6502, the instructions STY abs, STA abs, and STX abs are represented by the bytes sequence starting with $8C, $8D, and $8E respectively.Boolean wrote:What is the relation between [\x8C-\x8E]\x01\xA0 and the instructions?
That is, 0x8E 0x01 0xA0 = STX $A001
Re: About MMC3
Thank you.lidnariq wrote:To the 6502, the instructions STY abs, STA abs, and STX abs are represented by the bytes sequence starting with $8C, $8D, and $8E respectively.Boolean wrote:What is the relation between [\x8C-\x8E]\x01\xA0 and the instructions?
That is, 0x8E 0x01 0xA0 = STX $A001