News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Snes emulators (Canoe, Snes9x) -- game problems and fixes  (Read 357359 times)

Bosco82

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Re: Snes emulators (Canoe, Snes9x) -- game problems and fixes
« Reply #2980 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

arkiokin

  • Jr. Member
  • **
  • Posts: 97
    • View Profile
Re: Snes emulators (Canoe, Snes9x) -- game problems and fixes
« Reply #2981 on: May 18, 2019, 07:11:17 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

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Snes emulators (Canoe, Snes9x) -- game problems and fixes
« Reply #2982 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.

Here's the code in progress, it's not finished yet:
Spoiler:
Code: [Select]
;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

svenge

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Snes emulators (Canoe, Snes9x) -- game problems and fixes
« Reply #2983 on: May 20, 2019, 08:42:06 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

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
    • Solar Magic Advance Blog
Re: Snes emulators (Canoe, Snes9x) -- game problems and fixes
« Reply #2984 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.

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.
« Last Edit: May 20, 2019, 04:16:46 pm by LuigiBlood »

svenge

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: Snes emulators (Canoe, Snes9x) -- game problems and fixes
« Reply #2985 on: Today at 04:46:17 am »
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

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
    • Solar Magic Advance Blog
Re: Snes emulators (Canoe, Snes9x) -- game problems and fixes
« Reply #2986 on: Today at 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.