Snes emulators (Canoe, Snes9x) -- game problems and fixes

Started by sluffy, February 10, 2018, 11:25:45 PM

Previous topic - Next topic

arkiokin

Quote from: Bosco82 on May 17, 2019, 09:45:50 PM
Oda Nobunaga - Haou no Gundan https://www.sendspace.com/file/3w8g49
Super Daikoukai Jidai https://www.sendspace.com/file/hi1ehv

Very nice ! overscan issue totally fixed, good job and thank you very much Bosco ! :)

phonymike

I took a look at Special Tee Shot. The issue is that it is a BS game, and the same exact issues show up if you play it on an emulator that does not support BS.

The game is accessing the SRAM at $17:5000 which works fine on BS. But as a normal cart it needs to access SRAM at $70:0000.

I manually traced through and found many reads and writes and have patched them. I'm playing through the game to make sure there are no more that I missed. The game plays perfectly fine once all the SRAM addresses are patched.

Here's the code in progress, it's not finished yet:
Spoiler

;xkas v0.06
lorom


;========================================
; ** Set a variable for SRAM location **
;========================================
;!loc = $175000         ;original BS SRAM location
!loc = $700000          ;new cartridge SRAM location


;==========================
;Create new internal header
;==========================
org $FFC0
    db "BS Special Tee Shot  "
    ;  "---------------------" 21 characters

    db $30              ;LoROM and fastrom
    db $02              ;ROM/RAM/BATT
    db $0A              ;ROM size 8 mbit
    db $03              ;SRAM size 8KB
    db $00              ;Country: Japan
    db $01              ;Nintendo
    db $01              ;version 1.1
    dw $4B0B            ;checksum compliment
    dw $B4F4            ;good checksum ;)


;===========================================
;These values aren't absolute like the rest,
;but we can still put our variable into them
;===========================================
;org $8FACEA
;    ADC #$5C48          ;original code: combined with dest bank below makes BS SRAM address $17:5C48
org $8FACEB
    dw !loc+#$0C48      ;xkas tries to make this a long address, we manually insert 16 bit value of the variable, leave original ADC opcode

;org $8FACFD
;    MVN $7E17           ;original code: Block Move: source bank $7E, dest bank $17
org $8FACFE
    db !loc>>16         ;set dest bank as a byte, xkas is flaky with MVN


;==========
;SRAM reads
;==========

org $84D35F
    LDA !loc+$DE2,x

org $84E3E5
    LDA !loc+$DE2,x

org $84E474
    LDA !loc+$DE2,x

org $84E574
    LDA !loc+$D88,x

org $84E593
    LDA !loc+$D88,x

org $859077
    LDA !loc+$C20,x

org $859082
    LDA !loc+$C2A,x

org $8590A4
    LDA !loc+$C20,x

org $8590D9
    LDA !loc+$E0A

org $85910A
    LDA !loc+$E0C

org $859113
    LDA !loc+$E0E

org $859122
    LDA !loc+$E10

org $859139
    LDA !loc+$C28

org $8FAA69
    LDA !loc+$C48,x

org $8FAC5B
    LDA !loc+$F8E,x

org $8FACC3
    LDA !loc+$C20,x

org $8FAD3F
    LDA !loc+$C48,x

org $8FAEB3
    LDA !loc+$C20,x

org $8FAEC7
    LDA !loc+$DE2,x

org $8FAF01
    LDA !loc+$DE2,x

org $8FB03E
    LDA !loc+$E0A

org $8FB1C8
    LDA !loc+$F8E,x

org $8FB7B2
    LDA !loc+$C2A,x

org $8FB814
    LDA !loc+$C20,x

org $8FB920
    LDA !loc+$C20,x

org $8FB4DC
    LDA !loc+$C20,x

org $8FBEF6
    LDA !loc+$F8E,x

org $8FBF15
    LDA !loc+$F8E,x

org $8FBF30
    LDA !loc+$EDA,x

org $8FBF42
    LDA !loc+$E26,x

org $8FBF54
    LDA !loc+$E80,x

org $8FBFD7
    LDA !loc+$C20,x

org $8FC178
    LDA !loc+$E0A

org $8FC2F0
    LDA !loc+$E0A

org $8FC32F
    LDA !loc+$C2A,x
    STA $EB29
    LDA !loc+$C34,x
    STA $FCE6
    LDA !loc+$C20,x

org $8FC3C2
    LDA !loc+$E26,x
    STA $EB4D,y
    LDA !loc+$E80,x
    CLC
    ADC #$40
    STA $EB6D,y
    LDA !loc+$EDA,x
    STA $EB8D,y
    LDA !loc+$F34,x
    STA $EBAD,y
    LDA !loc+$F8E,x

org $8FC4FF
    LDA !loc+$C2A,x

org $8FC524
    LDA !loc+$E26,x
    STA $EB4D,y
    LDA !loc+$E80,x
    CLC
    ADC #$40
    STA $EB6D,y
    LDA !loc+$EDA,x
    STA $EB8D,y
    LDA !loc+$F34,x
    STA $EBAD,y
    LDA !loc+$F8E,x


;===========
;SRAM writes
;===========

org $84E4B6
    STA !loc+$DE2,x

org $84E555
    STA !loc+$C20,x
    LDA $FCE6
    STA !loc+$C34,x

org $84E57B
    STA !loc+$D88,x

org $84E5C5
    STA !loc+$C2A,x

org $84E5D0
    STA !loc+$C3E,x

org $84E51A
    STA !loc+$E0C
    LDA #$DA7E
    STA !loc+$E0E

org $8590B8
    STA !loc+$E0A

org $8590CA
    STA !loc+$E14,x

org $8590F4
    STA !loc+$E0C
    STA !loc+$E0E
    STA !loc+$E10
    STA !loc+$E12

org $8FAB9E
    STA !loc+$C48,x

org $8FABAD
    STA !loc+$C20,x
    STA !loc+$C2A,x
    STA !loc+$C34,x
    LDA #$FFFF
    STA !loc+$C3E,x

org $8FABCD
    STA !loc+$DE2,x

org $8FAC19
    STA !loc+$E26,x
    LDA #$8080
    STA !loc+$E80,x
    STA !loc+$EDA,x
    STA !loc+$F34,x
    STA !loc+$F8E,x

org $8FAC3D
    STA !loc+$E14,x

org $8FAC69
    STA !loc+$E26,x
    LDA #$80
    STA !loc+$E80,x
    STA !loc+$EDA,x
    STA !loc+$F34,x
    STA !loc+$F8E,x

org $8FAC98
    STA !loc+$D88,x

org $8FAFCA
    LDA !loc+$E0A


org $8FACD6
    STA !loc+$C20,x
    STA !loc+$C2A,x
    STA !loc+$C34,x

org $8FAD11
    STA !loc+$C3E,x

org $8FB1D7
    STA !loc+$E26,x
    LDA [$00],y
    INY
    STA !loc+$E80,x
    LDA [$00],y
    INY
    STA !loc+$EDA,x
    LDA [$00],y
    INY
    STA !loc+$F34,x
    LDA [$00],y
    CLC
    ADC #$05
    INY
    STA !loc+$F8E,x

org $8FC129
    LDA !loc+$E0A

org $8FC17D
    STA !loc+$E0A

org $8FC403
    STA !loc+$E26,x
    LDA $EB6D,y
    SEC
    SBC #$40
    STA !loc+$E80,x
    LDA $EB8D,y
    STA !loc+$EDA,x
    LDA $EBAD,y
    STA !loc+$F34,x
    LDA $EBCD,y
    STA !loc+$F8E,x

org $8FC43C
    STA !loc+$E14,x

org $8FC565
    STA !loc+$E26,x
    LDA $EB6D,y
    SEC
    SBC #$40
    STA !loc+$E80,x
    LDA $EB8D,y
    STA !loc+$EDA,x
    LDA $EBAD,y
    STA !loc+$F34,x
    LDA $EBCD,y
    STA !loc+$F8E,x

org $8FC59E
    STA !loc+$E14,x


;==================
;SRAM CMPs and ADDs
;==================

org $859050
    CMP !loc+$E14,x

org $859071
    CMP !loc+$C3E,x

org $8FAB5B
    ADC !loc+$C48,x

org $8FAB68
    ADC !loc+$C20,x
    CLC
    ADC !loc+$C2A,x
    CLC
    ADC !loc+$C34,x
    PLX
    CLC
    ADC !loc+$DE2,x
    CLC
    ADC !loc+$DE4,x
    CLC
    ADC !loc+$DE6,x
    CLC
    ADC !loc+$DE8,x

org $8FABEA
    ADC !loc+$E26,x
    CLC
    ADC !loc+$E80,x
    CLC
    ADC !loc+$EDA,x
    CLC
    ADC !loc+$F34,x
    CLC
    ADC !loc+$F8E,x

org $8FB819
    ADC !loc+$C34,x
[close]

svenge

Quote from: phonymike on May 19, 2019, 10:50:54 AM
I took a look at Special Tee Shot. The issue is that it is a BS game, and the same exact issues show up if you play it on an emulator that does not support BS.

The game is accessing the SRAM at $17:5000 which works fine on BS. But as a normal cart it needs to access SRAM at $70:0000.

I manually traced through and found many reads and writes and have patched them. I'm playing through the game to make sure there are no more that I missed. The game plays perfectly fine once all the SRAM addresses are patched.

Wow, that's great work!  Please do keep us posted on your results and post a patch once you're done with your analysis.  I'm really looking forward to playing Special Tee Shot on my SNES Classic w/o having to resort to Retroarch.

LuigiBlood

#2984
Okay so somehow I did the whole patching job for Special Tee Shot by myself without knowing of any similar attempts in the past.

Here's the source code of the patch (EDIT: It's very crude compared to the other one 2 posts earlier):
https://gist.github.com/LuigiBlood/533b13ddf30c1ea4a1edc987cd4c67da

BPS patch file:
https://drive.google.com/file/d/1b2rR9WsFazoSMFBQTsZoI9bxBPxAd6mu/view

And also, recently, a copy of the prototype of the game was found (dated 1992, and it's quite different gameplay wise to be considered as a different game, despite having the same graphics), and a Vidpro card of the game was being sold on eBay, so I made a Photoshop edit of the photo which you can find here: https://twitter.com/LuigiBlood/status/1130244006292668416

That said the Vidpro card WILL be scanned properly soon, so expect to change the boxart at one point (maybe to play the prototype at some point? ;) )

I must also say it's not fully tested, I did do a proper playthrough of Beginner course and did see no issues.
EDIT: I reached Extra 1 and didn't see anything weird.

svenge

Tried the .bps patch on my SNES Classic Mini and it seems to work well.  Played through the first two courses (out of nine total) with no abnormalities detected.  It also saves properly, which is great.

LuigiBlood

I did a full single player playthrough of my patch of Special Tee Shot to the Gold Course and watched the Staff Roll. I did not see any issue. I haven't tried multiplayer, that might be worth checking out but so far everything is good.

arkiokin

Quote from: LuigiBlood on May 21, 2019, 08:10:35 AM
I did a full single player playthrough of my patch of Special Tee Shot to the Gold Course and watched the Staff Roll. I did not see any issue. I haven't tried multiplayer, that might be worth checking out but so far everything is good.

Great result ! I will follow any other work you should bring for the future dump of for another title by chance :)

tqhoang

Quote from: Bosco82 on December 30, 2018, 03:59:11 PM
Haven't tested it yet but this should fix Tecmo Super NBA Basketball https://www.sendspace.com/file/l70fe6

Could you please re-upload?  The download links are both invalid now.  Thx!

arkiokin

Quote from: tqhoang on May 21, 2019, 09:44:17 PM
Could you please re-upload?  The download links are both invalid now.  Thx!

I suppose this is the one included in the compatibility sheet (see first page of this thread) ? : https://docs.google.com/spreadsheets/d/12HKfz4ZQBy6Ip5awvh8t2aV5cVswYlnsdKxn9xoIW2Y/edit#gid=2014317767

And so a permanent link here : https://drive.google.com/file/d/104bZEtXHyx2tyR0ZnikY2I_up4bSIJjk/view

tqhoang


arkiokin

#2991
Reported (on minisnes sub-Reddit) Joe&Mac graphical glitch on the first lava stage.
Video to show this issue : https://youtu.be/sKgo-WqRbD8

reyvgm


arkiokin

Quote from: reyvgm on May 26, 2019, 01:39:10 AM
Man, sluffy would have fixed that right away.

I agree, like a bunch of other issues discovered since his retirement  :-[
We miss you sluffy, hope you're fine ^^

phonymike

Quote from: LuigiBlood on May 20, 2019, 02:20:11 PM
Okay so somehow I did the whole patching job for Special Tee Shot by myself without knowing of any similar attempts in the past.

Hey LuigiBlood, I saw your name a few times when I looked around for romhacking BS games. I like your method of just patching the long address rather than including the assembly opcode. I was just copying a pasting from snes9x and changing the address  :-[

The patches look similar, we got tons of long addresses, the 16 bit ADC address, and the MVN. I didn't patch any two player stuff either, and mine does work in a single player playthrough. I don't think I've ever used that many savestates before lol.

Additional snes hardware always interested me, and now I know a little bit more about why BS games may have issues in older emulators, fullsnes has a lot of BS info, plus emulator source code. I hope our work can help others figure out what needs to be done to convert BS games. I think I did see some reads from the BS bios, but I didn't follow up to see what they could do. Snes9x geiger was just popping up reads and writes from unknown registers so that helped a lot. I wrote a quick program that searches for long addresses and shows them. It does show more addresses (and surely some false positives) in the game so there is more patching that can be done. Thanks for your good work!

LuigiBlood

Quote from: phonymike on May 26, 2019, 03:11:12 PM
Hey LuigiBlood, I saw your name a few times when I looked around for romhacking BS games. I like your method of just patching the long address rather than including the assembly opcode. I was just copying a pasting from snes9x and changing the address  :-[

The patches look similar, we got tons of long addresses, the 16 bit ADC address, and the MVN. I didn't patch any two player stuff either, and mine does work in a single player playthrough. I don't think I've ever used that many savestates before lol.

Additional snes hardware always interested me, and now I know a little bit more about why BS games may have issues in older emulators, fullsnes has a lot of BS info, plus emulator source code. I hope our work can help others figure out what needs to be done to convert BS games. I think I did see some reads from the BS bios, but I didn't follow up to see what they could do. Snes9x geiger was just popping up reads and writes from unknown registers so that helped a lot. I wrote a quick program that searches for long addresses and shows them. It does show more addresses (and surely some false positives) in the game so there is more patching that can be done. Thanks for your good work!
I did not use logs initially for this, I just searched through the hex (thanks to regex) and managed to find every single address. The only exception was the ADC and MVN one. In theory it should work for everything.

Basically anyway it's just about relocating BS-X SRAM which uses $10-17:5000-5FFF. At least most of the time because you will not be able to make Treasure Conflix work easily, for exemple, because it's a game that makes use of BS-X's font data, and also the BS-X PSRAM, which is relocatable too, that one would be insane work, for real.

svenge

Now that an English-language ROM rip of Seiken Densetsu 3 (aka "Trials of Mana") from "Collection of Mana" for the Switch has been put out there, is there any way to get it running via Canoe?  It's a 6MB ExHiRom file, so I don't think you can just drag-and-drop it without some modifications and/or specific preset settings.

It does work just fine in Snes9x v1.59.2 for Windows, so it's not like it's of a completely unknown format...

Samus12345

#2997
I don't know if this was just an issue with my SNES Classic or what, but The Shadow (USA) (Proto 1) wouldn't load for me - it just gave a C7 error. The (Proto 2) rom worked, but it has graphical glitches on some of the enemy's frames. I pulled the graphical data from proto 1 and put it in proto 2 and it fixed it. Here's a patch for Proto 2 if anyone else needs it: https://drive.google.com/open?id=1cZsSCRpxdEkBsSyK-bDyWGOnwEVtUeGP

The stage intermissions with dialogue are missing some background graphics in Canoe, but the gameplay itself seems fine.

Dzumeister

Quote from: svenge on June 12, 2019, 06:58:49 PM
Now that an English-language ROM rip of Seiken Densetsu 3 (aka "Trials of Mana") from "Collection of Mana" for the Switch has been put out there, is there any way to get it running via Canoe?  It's a 6MB ExHiRom file, so I don't think you can just drag-and-drop it without some modifications and/or specific preset settings.

It does work just fine in Snes9x v1.59.2 for Windows, so it's not like it's of a completely unknown format...

Why does Canoe have issues with expanded ROMs?
free sluffy

svenge

Probably because only two titles ever used 48Mb ROMs (i.e. Star Ocean and Tales of Phantasia).  Additionally it's not like Squenix and Bamco (those two games' respective current owners) were going to license them for use in the Japanese version of the SNES Classic, so that left absolutely zero incentive for NERD to code in support for games of that size.

It's only because of the hard work put in by people like Sluffy and DarkAkuma (among others) that patches were created that allowed Canoe to properly play those ROMs.  Hopefully someone will do the same for Trials of Mana, but it's only been a few days since its English-language release so I'm not expecting anything in the immediate term.  At worst I can still play the fan-translation on my SNES Classic (as I don't care for installing Retroarch on it for sentimental reasons), or else play the official translation on any number of other devices that have emulators with ExHiRom support.

Another thing is that I've already had my "Great White Whale" (i.e. Special Tee Shot) get a Canoe patch recently, so I really can't ask for much more from the hacking community.