News: 11 March 2016 - Forum Rules

Author Topic: Faxanadu - Assembly  (Read 18172 times)

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #20 on: April 06, 2015, 09:13:00 am »
What I see is that it indeed is loading data, however, certain addresses between the US and JP version are different, so it's trying to branch/jmp/jsr to JP code instead of US code. Look for the death/respawn routine, and look for a jmp or jsr from the end of my load routine. Modify the address to match the US respawn routine.

// Alternatively, look for the end of the US password successful checksum routine.
« Last Edit: April 06, 2015, 09:19:31 am by umaggot »

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #21 on: April 06, 2015, 09:54:06 am »
Your routine ends with JMP 8271 and that routine seems to be the same in both us and jap versions.

I think i need to check that checksum-routine. Any ideas about where to start looking?

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #22 on: April 06, 2015, 10:26:52 am »
Unmodified US version, input a valid password, make a save state. Use the trace logger, and set a breakpoint for... gold. Something, anything that would be loaded. If you have further questions, we should discuss this via e-mail or PM.

// Regarding my hack, I plan to disassemble my project and put the disassembly on my phone. I have two hours per work day (generally) between work and home (I'm pretty busy. :-X) that I can use to look at the code. I'm hoping that I can get dcc6502 running on Windows 7, but will look into dosbox if all else fails.

// SmartRENES... I'll try that.

// So far... no luck. I just want a comprehensive disassembly of my hack, showing each line in ASM (Like FCEUX), in TXT or HTML format.
« Last Edit: April 06, 2015, 12:25:20 pm by umaggot »

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #23 on: April 06, 2015, 11:20:59 am »
yes, some success! :-)
https://youtu.be/Jjxt3FNAfZQ

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #24 on: April 07, 2015, 07:40:14 am »
Alright, forget that foolishness. So what we have here is a crash. If you talk to the smoker in Eolis, he says "It looks like the end is near."

Here's the interesting part: A normal RTS opcode will send the game to crash, by making it read 00:1100 (from 0F:F44D). I'm guessing this may have something to do with the stack. I'm also guessing that the stack can be thrown off by things like an uneven amount of PLA/PHA opcodes being run in a row. If I'm missing something important in my observations, please let me know. :-[

// Also, as of 2-10-2014 (with the latest update being 2-11-2014), here are most of the dialogue routines across banks 0F, 0C, and 10:

Spoiler:
10:BECB JMP Dialogue Routine
10:BECB:EA EA EA NOP
10:BECE:4C 8D BF JMP $BF8D ; JuMP to Dialogue Routine at 10:BF8D
10:BED1:AD 15 02 LDA $0215 = #$04 ; LoaD Page End Countdown to A
10:BED4:F0 2A BEQ $BF00 ; If equal to #$00, branch to PLB Checks at 0F:BF00
10:BED6:60 RTS -----------------------------------------
10:BED7 Page Post
10:BED7:98 TYA ; Transfer Y to A
10:BED8:E9 1F SBC #$1F ; SuBtract #$1F and Carry Flag from A
10:BEDA:8D 16 02 STA $0216 = #$02 ; STore A to Letter Position
10:BEDD:D0 11 BNE $BEF0 ; Branch if Not Equal to #$00, to Skip PLB at 10:BEF0
10:BEDF:AD 17 02 LDA $0217 = #$00 ; LoaD Line Position to A
10:BEE2:C9 04 CMP #$04 ; Is Line Position #$04?
10:BEE4:90 0A BCC $BEF0 ; If less than #$04, branch to Skip PLB at 10:BEF0
10:BEE6:AD 15 02 LDA $0215 = #$04 ; LoaD Page End Countdown to A
10:BEE9:F0 05 BEQ $BEF0 ; If equal to #$00, branch to Skip PLB at 10:BEF0
10:BEEB:EA EA NOP
10:BEED:20 88 F6 JSR $F688 ; Jump to SubRoutine Page Line Break at 0F:F688
10:BEF0 Skip PLB
10:BEF0:AC 16 02 LDY $0216 = #$02 ; LoaD Letter Position to Y
10:BEF3:98 TYA ; Transfer Y to A
10:BEF4:4C C7 BF JMP $BFC7 ; JuMP to Increase Line Position at 10:BFC7
10:BEF7:20 88 F6 JSR $F688 ; Jump to SubRoutine Page Line Break at 0F:F688
10:BEFA:20 6E F5 JSR $F56E ; Jump to SubRoutine Print Character at 0F:F56E
10:BEFD:4C 45 BF JMP $BF45 ; JuMP to Begin CC Check
10:BF00 PLB Checks
10:BF00:B1 EC LDA ($EC),Y @ $8633 = #$11 ; Load Current Letter to A at $EC+$0214 or $0216
10:BF02:C9 FA CMP #$FA ; Is Current Letter #$FA?
10:BF04:90 05 BCC $BF0B ; If less than #$FA, branch to Begin RC Check at 10:BF0B
10:BF06:E6 EC INC $00EC = #$80 ; INCrease $00EC by #$01
10:BF08:EE 14 02 INC $0214 = #$B4 ; INCrease $0214 by #$01
10:BF0B Begin RC Check
10:BF0B:A2 00 LDX #$00 ; LoaD #$00 to X
10:BF0D Remaining Characters Check
10:BF0D:E8 INX ; INcrease X by #$01
10:BF0E:C8 INY ; INcrease Y by #$01
10:BF0F:B1 EC LDA ($EC),Y @ $8633 = #$11 ; Load Current Letter to A at $EC+$0214 or $0216
10:BF11:C9 FF CMP #$FF ; Is Current Letter #$FF?
10:BF13:D0 F8 BNE $BF0D ; If not, branch to Remaining Characters Check at 10:BF0D
10:BF15:E0 10 CPX #$10 ; Is X #$10?
10:BF17:B0 01 BCS $BF1A ; If greater than or equal to #$10, branch to 10:BF1A
10:BF19:60 RTS -----------------------------------------
10:BF1A:CE 17 02 DEC $0217 = #$00 ; DECrease Line Position by #$01
10:BF1D:CE 17 02 DEC $0217 = #$00 ; DECrease Line Position by #$01
10:BF20:AC 16 02 LDY $0216 = #$02 ; LoaD Letter Position to Y
10:BF23:C0 02 CPY #$02 ; Is Letter Position #$02?
10:BF25:90 09 BCC $BF30 ; If less than #$02, branch to Letter Position Reset at 10:BF30
10:BF27 DELP
10:BF27:88 DEY ; DEcrease Letter Position by #$01
10:BF28:88 DEY ; DEcrease Letter Position by #$01
10:BF29:C0 02 CPY #$02 ; Is Letter Position #$02?
10:BF2B:B0 FA BCS $BF27 ; If greater than or equal to #$02, branch to DELP at 10:BF27
10:BF2D:8C 16 02 STY $0216 = #$02 ; STore Y to Letter Position
10:BF30 Letter Position Reset
10:BF30:A9 04 LDA #$04 ; LoaD #$04 to A
10:BF32:8D 15 02 STA $0215 = #$04 ; STore A to Page End Countdown
10:BF35:8D 1B 02 STA $021B = #$04 ; STore A to
10:BF38:B1 EC LDA ($EC),Y @ $8633 = #$11 ; Load Current Letter to A at $EC+$0214 or $0216
10:BF3A:20 6E F5 JSR $F56E ; Jump to SubRoutine Print Character at 0F:F56E
10:BF3D:20 88 F6 JSR $F688 ; Jump to SubRoutine Page Line Break at 0F:F688
10:BF40:70 89 BVS $BECB ; Branch on oVerflow flag Set to JMP Dialogue Routine at 10:BECB
10:BF42:4C 93 BF JMP $BF93 ; JuMP to Check PEC at 10:BF93
10:BF45 Begin CC (Character Code) Check
10:BF45:B1 EC LDA ($EC),Y @ $8633 = #$11 ; LoaD Current Letter to A at $EC+$0214 or $0216
10:BF47:C9 FA CMP #$FA ; Is Current Letter #$FA?
10:BF49:D0 14 BNE $BF5F ; If not, branch to Continue CC Check
10:BF4B:A9 00 LDA #$00 ; LoaD #$00 to A
10:BF4D:8D 15 02 STA $0215 = #$04 ; STore A to Page End Countdown
10:BF50:8D 16 02 STA $0216 = #$02 ; STore A to Letter Position
10:BF53:8D 17 02 STA $0217 = #$00 ; STore A to Line Position
10:BF56:8D 1C 02 STA $021C = #$00 ; STore A to
10:BF59:60 RTS -----------------------------------------
10:BF5A:EA EA EA NOP
10:BF5D:EA EA NOP
10:BF5F Continue CC Check
10:BF5F:C9 FF CMP #$FF ; Is Current Letter #$FF?
10:BF61:F0 7C BEQ $BFDF ; If so, branch to End Message
10:BF63:C9 FE CMP #$FE ; Is Current Letter #$FE?
10:BF65:F0 4D BEQ $BFB4 ; If so, branch to Line Break
10:BF67:C9 FD CMP #$FD ; Is Current Letter #$FD?
10:BF69:F0 3F BEQ $BFAA ; If so, branch to (Print) Space Branch
10:BF6B:C9 FC CMP #$FC ; Is Current Letter #$FC?
10:BF6D:F0 76 BEQ $BFE5 ; If so, branch to Name
10:BF6F:C9 FB CMP #$FB ; Is Current Letter #$FB?
10:BF71:F0 7B BEQ $BFEE ; If so, branch to Title
10:BF73:AE 12 02 LDX $0212 = #$01 ; LoaD $0212 to X
10:BF76:F0 07 BEQ $BF7F ; Is $0212 #$00? If so, branch to $0212=#$00
10:BF78:48 PHA ; PusH A
10:BF79:A9 01 LDA #$01 ; Load #$01 to A
10:BF7B:20 E4 D0 JSR $D0E4 ; Jump to SubRoutine $D0E4
10:BF7E:68 PLA ; PulL A
10:BF7F $0212=#$00
10:BF7F:20 32 F7 JSR $F732 ; Jump to SubRoutine $F732
10:BF82:AD 16 02 LDA $0216 = #$02 ; Load Letter Position to A
10:BF85:D0 05 BNE $BF8C ; Is Letter Position #$00? If not, branch to Resume Routine
10:BF87:AD 17 02 LDA $0217 = #$00 ; Load Line Position to A
10:BF8A:F0 01 BEQ $BF8D ; Is Line Position #$00? If so, branch to Dialogue Routine
10:BF8C Resume Routine
10:BF8C:60 RTS -----------------------------------------
10:BF8D Dialogue Routine
10:BF8D:EE 16 02 INC $0216 = #$02 ; Increase Letter Position by #$01
10:BF90:EE 16 02 INC $0216 = #$02 ; Increase Letter Position by #$01
10:BF93 Check PEC
10:BF93:AD 15 02 LDA $0215 = #$04 ; Load Page End Countdown to A
10:BF96:F0 F4 BEQ $BF8C ; Is Page End Countdown #$00? If so, branch to Resume Routine at 10:BF8C
10:BF98:AD 13 02 LDA $0213 = #$9F ; Load Message ID to A
10:BF9B:F0 EF BEQ $BF8C ; Is Message ID #$00? If so, branch to Resume Routine at 10:BF8C
10:BF9D:A9 01 LDA #$01 ; Load #$01 to A
10:BF9F:8D 12 02 STA $0212 = #$01 ; STore A to $0212
10:BFA2:20 E4 D0 JSR $D0E4 ; Jump to Dialogue SFX at 0F:D0E4
10:BFA5:A9 00 LDA #$00 ; Load #$00 to A
10:BFA7:20 25 CA JSR $CA25 ; Jump to Pause at 0F:CA25
10:BFAA (Print) Space Branch
10:BFAA:20 6E F5 JSR $F56E ; Jump to SubRoutine Print Character at 0F:F56E
10:BFAD:AD 16 02 LDA $0216 = #$02 ; LoaD Letter Position to A
10:BFB0:C9 1E CMP #$1E ; Is Letter Position #$1E?
10:BFB2:90 D9 BCC $BF8D ; If less than #$1E, branch to Dialogue Routine at 10:BF8D
10:BFB4 Line Break
10:BFB4:AC 16 02 LDY $0216 = #$02 ; Load Letter Position to Y
10:BFB7:C0 1F CPY #$1F ; Is Letter Position #$1F?
10:BFB9:B0 06 BCS $BFC1 ; If greater than or equal to #$1F, branch to Page Countdown at 10:BFC1
10:BFBB Letter Increase
10:BFBB:C8 INY ; INcrease (Y) Letter Position by #$01
10:BFBC:C8 INY ; INcrease (Y) Letter Position by #$01
10:BFBD:C0 1F CPY #$1F ; Is Letter Position #$1F?
10:BFBF:90 FA BCC $BFBB ; If less than #$1F, branch to Letter Increase at 10:BFBB
10:BFC1 Page Countdown
10:BFC1:CE 15 02 DEC $0215 = #$04 ; Decrease Page End Countdown by #$01
10:BFC4:4C D7 BE JMP $BED7 ; JuMP to Page Post at 10:BED7
10:BFC7 Increase Line Position
10:BFC7:EA EA EA NOP
10:BFCA:AD 16 02 LDA $0216 = #$02 ; LoaD Letter Position to A
10:BFCD:D0 C4 BNE $BF93 ; Is Letter Position #$00? If not, branch to Check PEC
10:BFCF:EE 17 02 INC $0217 = #$00 ; INCrease Line Position by #$01
10:BFD2:EE 17 02 INC $0217 = #$00 ; INCrease Line Position by #$01
10:BFD5:AD 17 02 LDA $0217 = #$00 ; LoaD Line Position to A
10:BFD8:C9 04 CMP #$04 ; Is Line Position #$04
10:BFDA:90 B7 BCC $BF93 ; If less than #$04, branch to Check PEC
10:BFDC:4C 85 F6 JMP $F685 ; JuMP to Bank Switch PLB at 0F:F685
10:BFDF End Message
10:BFDF:A9 00 LDA #$00 ; LoaD #$00 to A
10:BFE1:8D 13 02 STA $0213 = #$9F ; STore A to Message ID
10:BFE4:60 RTS -----------------------------------------
10:BFE5 Name
10:BFE5:AD C2 04 LDA $04C2 = #$46
10:BFE8:EE 1C 02 INC $021C = #$00
10:BFEB:4C F2 F5 JMP $F5F2
10:BFEE Title
10:BFEE:A9 81 LDA #$81
10:BFF0:8D 1C 02 STA $021C = #$00
10:BFF3:AD 37 04 LDA $0437 = #$0D
10:BFF6:0A ASL
10:BFF7:0A ASL
10:BFF8:0A ASL
10:BFF9:AA TAX
10:BFFA:BD 91 F7 LDA $F791,X @ $F7A1 = #$1B
10:BFFD:4C F2 F5 JMP $F5F2

0F:F541 Clear Message Box, Begin Dialogue Routine
0F:F541:A9 00 LDA #$00
0F:F543:8D 1A 02 STA $021A = #$00
0F:F546:8D 16 02 STA $0216 = #$00
0F:F549:8D 17 02 STA $0217 = #$00
0F:F54C:8D 1C 02 STA $021C = #$00
0F:F54F:A9 04 LDA #$04
0F:F551:8D 15 02 STA $0215 = #$00
0F:F554:8D 1B 02 STA $021B = #$00
0F:F557:4C 0A F7 JMP $F70A
0F:F55A:AD 00 01 LDA $0100 = #$0E
0F:F55D:48 PHA
0F:F55E:A2 10 LDX #$10
0F:F560:20 1A CC JSR $CC1A
0F:F563:E6 E1 INC $00E1 = #$00
0F:F565:8D 12 02 STA $0212 = #$00
0F:F568:20 83 F5 JSR $F583
0F:F56B:4C 4D F4 JMP $F44D
0F:F56E:AD 00 01 LDA $0100 = #$0E
0F:F571:48 PHA
0F:F572:A2 10 LDX #$10
0F:F574:20 1A CC JSR $CC1A
0F:F577:A9 00 LDA #$00
0F:F579:8D 12 02 STA $0212 = #$00
0F:F57C:20 93 F5 JSR $F593
0F:F57F:4C 4D F4 JMP $F44D
0F:F582:60 RTS -----------------------------------------

0F:F583:AD 13 02 LDA $0213 = #$00
0F:F586:F0 FA BEQ $F582
0F:F588:AD 15 02 LDA $0215 = #$00
0F:F58B:F0 F5 BEQ $F582
0F:F58D:A5 E1 LDA $00E1 = #$00
0F:F58F:29 04 AND #$04
0F:F591:D0 EF BNE $F582
0F:F593:AD 1C 02 LDA $021C = #$00
0F:F596:F0 2F BEQ $F5C7
0F:F598:30 16 BMI $F5B0
0F:F59A:C9 04 CMP #$04
0F:F59C:F0 0B BEQ $F5A9
0F:F59E:AA TAX
0F:F59F:BD C2 04 LDA $04C2,X @ $04D0 = #$00
0F:F5A2:EE 1C 02 INC $021C = #$00
0F:F5A5:C9 FF CMP #$FF
0F:F5A7:D0 49 BNE $F5F2
0F:F5A9:A9 00 LDA #$00
0F:F5AB:8D 1C 02 STA $021C = #$00
0F:F5AE:F0 17 BEQ $F5C7
0F:F5B0:C9 88 CMP #$88
0F:F5B2:F0 F5 BEQ $F5A9
0F:F5B4:29 07 AND #$07
0F:F5B6:85 EC STA $00EC = #$3E
0F:F5B8:AD 37 04 LDA $0437 = #$00
0F:F5BB:0A ASL
0F:F5BC:0A ASL
0F:F5BD:0A ASL
0F:F5BE:05 EC ORA $00EC = #$3E
0F:F5C0:AA TAX
0F:F5C1:BD 91 F7 LDA $F791,X @ $F79F = #$0D
0F:F5C4:4C A2 F5 JMP $F5A2

0F:F5C7:AD 18 02 LDA $0218 = #$00
0F:F5CA:85 EC STA $00EC = #$3E
0F:F5CC:AD 19 02 LDA $0219 = #$00
0F:F5CF:85 ED STA $00ED = #$FD
0F:F5D1:AC 14 02 LDY $0214 = #$B4
0F:F5D4:EE 14 02 INC $0214 = #$B4
0F:F5D7:D0 03 BNE $F5DC
0F:F5D9:EE 19 02 INC $0219 = #$A9
0F:F5DC:4C 45 BF JMP $BF45

0F:F5EF:4C 4D F4 JMP $F44D
0F:F5F2:F0 5D BEQ $F651
0F:F5F4:4C 73 BF JMP $BF73

0F:F44D:68 PLA
0F:F44E:AA TAX
0F:F44F:20 1A CC JSR $CC1A
0F:F452:60 RTS -----------------------------------------

0F:F651:A9 81 LDA #$81
0F:F653:8D 1C 02 STA $021C = #$00
0F:F656:AD 37 04 LDA $0437 = #$00
0F:F659:0A ASL
0F:F65A:0A ASL
0F:F65B:0A ASL
0F:F65C:AA TAX
0F:F65D:BD 91 F7 LDA $F791,X @ $F79F = #$0D
0F:F660:4C F2 F5 JMP $F5F2
0F:F663:85 EC STA $00EC = #$3E
0F:F665:A9 00 LDA #$00
0F:F667:06 EC ASL $00EC = #$3E
0F:F669:2A ROL
0F:F66A:06 EC ASL $00EC = #$3E
0F:F66C:2A ROL
0F:F66D:06 EC ASL $00EC = #$3E
0F:F66F:2A ROL
0F:F670:06 EC ASL $00EC = #$3E
0F:F672:2A ROL
0F:F673:06 EC ASL $00EC = #$3E
0F:F675:2A ROL
0F:F676:85 ED STA $00ED = #$FD
0F:F678:A5 EC LDA $00EC = #$3E
0F:F67A:69 00 ADC #$00
0F:F67C:85 EC STA $00EC = #$3E
0F:F67E:A5 ED LDA $00ED = #$FD
0F:F680:69 80 ADC #$80
0F:F682:85 ED STA $00ED = #$FD
0F:F684:60 RTS -----------------------------------------

0F:CA25 Pause
0F:CA25:A9 00 LDA #$00
0F:CA27:85 10 STA $0010 = #$00
>0F:CA29:A5 10 LDA $0010 = #$00
0F:CA2B:F0 FC BEQ $CA29
0F:CA2D:60 RTS -----------------------------------------


0F:D0E4 Dialogue SFX
0F:D0E4:8D 36 04 STA $0436 = #$00
0F:D0E7:8A TXA
0F:D0E8:48 PHA
0F:D0E9:98 TYA
0F:D0EA:48 PHA
0F:D0EB:AD 36 04 LDA $0436 = #$00
0F:D0EE:20 6F F3 JSR $F36F
0F:D0F1:68 PLA
0F:D0F2:A8 TAY
0F:D0F3:68 PLA
0F:D0F4:AA TAX
0F:D0F5:60 RTS -----------------------------------------

0F:F685 Bank Switch PLB
0F:F685:4C DF F5 JMP $F5DF ; JuMP to 0F:F5DF
0F:F5DF:AD 00 01 LDA $0100 = #$0E ; LoaD Bank to A
0F:F5E2:C9 10 CMP #$10 ; Is Bank #$10?
0F:F5E4:F0 06 BEQ $F5EC : If so, branch to End Bank Switch at 0F:F5EC
0F:F5E6:48 PHA ; PusH A
0F:F5E7:A2 10 LDX #$10 ; LoaD #$10 to X
0F:F5E9:20 1A CC JSR $CC1A ; Jump to SubRoutine Bank Switch at 0F:CC1A
0F:F5EC End Bank Switch
0F:F5EC:20 00 BF JSR $BF00 ; JuMP to PLB Checks at 10:BF00
0F:F688 Page Line Break
0F:F688:AD 08 02 LDA $0208 = #$00
0F:F68B:18 CLC
0F:F68C:69 02 ADC #$02
0F:F68E:85 EA STA $00EA = #$00
0F:F690:AD 09 02 LDA $0209 = #$00
0F:F693:18 CLC
0F:F694:69 02 ADC #$02
0F:F696:85 EB STA $00EB = #$00
0F:F698:20 CC F8 JSR $F8CC
0F:F69B:AE 1A 02 LDX $021A = #$00
0F:F69E:20 E8 F6 JSR $F6E8
0F:F6A1:20 E8 F6 JSR $F6E8
0F:F6A4:20 E8 F6 JSR $F6E8
0F:F6A7:A9 00 LDA #$00
0F:F6A9:A0 10 LDY #$10
0F:F6AB:20 12 F9 JSR $F912
0F:F6AE:AE 1A 02 LDX $021A = #$00
0F:F6B1:BD 2A F7 LDA $F72A,X @ $F738 = #$E9
0F:F6B4:85 E8 STA $00E8 = #$C0
0F:F6B6:BD 2E F7 LDA $F72E,X @ $F73C = #$0A
0F:F6B9:85 E9 STA $00E9 = #$23
0F:F6BB:A2 10 LDX #$10
0F:F6BD:8A TXA
0F:F6BE:48 PHA
0F:F6BF:A9 00 LDA #$00
0F:F6C1:A0 10 LDY #$10
0F:F6C3:20 12 F9 JSR $F912
0F:F6C6:20 EE F8 JSR $F8EE
0F:F6C9:68 PLA
0F:F6CA:AA TAX

0C:9D8D:AD 15 02 LDA $0215 = #$04
0C:9D90:D0 F4 BNE $9D86
0C:9D92:20 D9 9D JSR $9DD9
0C:9D95:A5 19 LDA $0019 = #$80
0C:9D97:10 ED BPL $9D86
0C:9D99:A9 04 LDA #$04
0C:9D9B:8D 15 02 STA $0215 = #$04
0C:9D9E:A9 04 LDA #$04
>0C:9DA0:8D 1B 02 STA $021B = #$04
0C:9DA3:20 41 F5 JSR $F541
0C:9DA6:18 CLC
0C:9DA7:A9 01 LDA #$01
0C:9DA9:60 RTS -----------------------------------------

Obviously a lot of this stuff can be consolidated, rewritten in smaller code. I do have this saved on my phone, so I'll take a look. I imagine there is some redundant code, as well. (Due to partial original dialogue code from the JP version)
« Last Edit: April 07, 2015, 09:18:13 am by umaggot »

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #25 on: April 07, 2015, 06:23:05 pm »
I've sent this video link to umaggot in a PM, which shows some graphics corruption after SRAM save: https://youtu.be/qqJHjAVROKQ



But I've fixed some of it here  ;D: https://youtu.be/LJBJFZWQyiI
It was a JSR that I had missed redirecting according to US ROM code.

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #26 on: April 07, 2015, 06:52:50 pm »
Nice! Maybe... the extra save icon might be misplaced garbage. I know I did a layering effect to cover up garbage (I.E. the save icon is overlapping garbage) If you could figure out how to scoot that junk to the left, you'll be good to go. :thumbsup:

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #27 on: April 07, 2015, 07:09:20 pm »
I think that this is the layering effect you're after:


The original Japanese Faxanadu rom is the above and your beta hack is in the bottom.
The bytes in RED are the ones that has been modified with your hack.

But that is one thing that I can't find in the US ROM :-(

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #28 on: April 08, 2015, 08:03:16 am »
It looks like a graphics table; particularly, this should tell the game how to display and mirror each 8x8 square. It would be strange if the US version did not have the same table, but I can see that happening.

// So it looks like my code messes up the stack somewhere. I'm looking for a PLA without a PHA, I believe. There are no obvious instances of this, which means it will eventually JMP $F44D without a PHA. 0F:F44D begins with a PLA and ends with the RTS that pulls a faulty stack pointer. I will continue to seek this out today.

// I did test out the following:

Spoiler:
> PHA (inserted)

0F:F5EF:4C 4D F4  JMP $F44D
 0F:F5F2:F0 5D     BEQ $F651
 0F:F5F4:4C 73 BF  JMP $BF73

Which eliminates the crash in that specific instance. It does, however, present a problem everywhere else. I've also narrowed it down to one of two instances; line 4 is full (16 characters) and/or line 5 begins with Control Code: [End Dialogue]
« Last Edit: April 08, 2015, 09:36:26 am by umaggot »

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #29 on: April 08, 2015, 05:35:08 pm »
Hmm, I can't really find that code in my ROM with your patch :-/

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #30 on: April 08, 2015, 08:10:34 pm »
Ah; no, sorry. I was talking about my Retranslation hack. Everything after the edit has nothing to do with the SRAM hack.

  • Retranslation
Still looking into the crashes. So far I'm thinking of creating a new code in a blank area (before neatly reorganizing all code), and running a check for last letter/line, INY, LDA ($EC),Y [current letter], CMP control codes #$FF [End Dialogue], #$FE [Line Break], #$FA [New Page], and immediately execute their respective routines -- otherwise, continue to run [Page End Routine].
« Last Edit: April 09, 2015, 09:00:50 am by umaggot »

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #31 on: April 10, 2015, 07:04:16 pm »
Darn, this ½ doubled Floppy icon is bugging the hell out of me!!

Bisqwit

  • Sr. Member
  • ****
  • Posts: 424
  • Polite, but politically incorrect.
    • View Profile
    • http://iki.fi/bisqwit/
Re: Faxanadu - Assembly
« Reply #32 on: May 12, 2015, 02:25:47 am »
Uh, what icon where?

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #33 on: May 12, 2015, 03:39:14 am »
Bisqwit: see the video here https://youtu.be/LJBJFZWQyiI, 0:12 in

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #34 on: May 23, 2015, 09:01:40 am »
You won't have to worry about fixing the floppy icon. The "Faxanadu Restoration (T-HudsonUSA) 05-31-15" patch (with just about every conceivable bugfix) is almost complete. We just need testers! :laugh:
« Last Edit: May 31, 2015, 09:49:05 pm by umaggot »

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #35 on: June 01, 2015, 05:13:31 pm »
Awesome umaggot!

Sign me up for testing :-)

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #36 on: June 01, 2015, 07:05:22 pm »
Congrats, you are now signed up for testing! Check your PM inbox for the patch. :)

// Groovy. I broke the game save feature. Again. :banghead:

8:07 PM:// Luckily, it's something simple, and you can still save if needed. (Otherwise, just press B!) :laugh: I just need to make sure to switch to bank #10 before $F600.

9:06 PM:// Sent you the fixed patch.
« Last Edit: June 01, 2015, 09:07:05 pm by umaggot »

frsj8112

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: Faxanadu - Assembly
« Reply #37 on: June 02, 2015, 03:50:58 pm »
Patched the rom and ran a quick test. Is it possible to increase the text speed?

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #38 on: June 02, 2015, 05:14:56 pm »
We're finally ready to release the Faxanadu (J) Restoration Vanilla (T-HudsonUSA) patch. This covers several bug fixes, retains uncensored work, adds SRAM and text speed-up options. There is just one problem. This patch only works on FCEU based emulators, due to doubling the size of the 256k MMC1 to 512k MMC1. We can't get anything else (other emulators and hardware) to read Bank 10. Since this patch is the basis for future patches (Retranslation, Remix, and Literal Faxanadu) we'd like to fix this bug and learn more about accessing Bank 10 on other emulators and hardware, before moving forward.

We doubled the size via King Mike's ROM Expansion utility, and changed the SRAM byte. Other than that, I just used regular bank switching (TXA, PHA, LDX #$10, JSR CC1A). I have no idea which bank is being read in other emulators, but further testing by implementing my dialogue code within bank 0F has shown that only garbage will be loaded when reading bank 10 in other emulators and flash carts, where FCEU will read bank 10 without any problems.

// ...Maybe "bank 10" is just not a good bank to use for this purpose?

// Looks like I need to adjust byte 4, and do more research. Found some pretty neat documentation. :)

// Nope. Either King Mike's utility or I myself have already adjusted byte 4 from 10 to 20. Byte 6 went from 10 to 12, which only affects battery backed SRAM.
« Last Edit: July 01, 2015, 08:52:12 pm by umaggot »

umaggot

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Faxanadu - Assembly
« Reply #39 on: July 04, 2015, 08:37:18 am »
Faxanadu Restoration has been released!
Don't forget to update your bookmarks!

Oops! Also, it looks like I made a bad link on the main page. Go to the download page to access the patch. :)
« Last Edit: July 04, 2015, 09:02:20 am by umaggot »