SHARE
TWEET

BS-X Limited Starts Removal via SRAM

LuigiBlood Apr 3rd, 2016 (edited) 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Satellaview - Hijack these functions:
  2. 105A2C: JML $80CA3F : scan_flash_directory
  3. 105A44: JML $80CD20 : get_flash_file_header_5A
  4. 105A4C: JML $80CDC6 : search_test_file_header, out:[57]
  5. 105A5C: JML $80CE92 : decrease_limited_starts
  6.  
  7. CHANGES:
  8. File Offset:
  9. 4A9B: 10 -> 80
  10. 4D6D: 10 -> 80
  11. 4DED: 10 -> 80
  12. 4E9A: 10 -> 80
  13.  
  14. ------------------------scan_flash_directory
  15.     PHP
  16.     PHB
  17.     PHK
  18.     PLB
  19.     SEP #$20
  20.     LDA #$FF
  21.     STA $1445
  22.     REP #$30
  23.     STZ $1447
  24.     STZ $1449
  25.     STZ $5A
  26.     LDX #$0000
  27.  
  28. label_00CA57:
  29.     REP #$30
  30.     STZ $57
  31.     SEP #$30
  32.     STX $5C
  33.     TXA
  34.     LSR A
  35.     LSR A
  36.     LSR A
  37.     TAY
  38.     TXA
  39.     AND #$07
  40.     TAX
  41.     LDA $1447,Y
  42.     AND $E9,X
  43.     DEX
  44.     BNE label_00CAD4
  45.  
  46. label_00CA70:
  47.     SEP #$30
  48.     LDX $5C
  49.     LDA $CAF1,X
  50.     STA $59
  51.     REP #$30
  52.     LDY #$7FDC
  53.     LDA [$57],Y
  54.     INY
  55.     INY
  56.     EOR [$57],Y
  57.     CMP #$FFFF
  58.     BNE label_00CABB
  59.     LDY #$7FDA
  60.     LDA [$57],Y
  61.     AND #$00FF
  62.     CMP #$0033
  63.     BNE label_00CABB
  64.     LDY #$7FD4          ;;START LIMITED START CHECK, remove this check altogether
  65.     LDA [$57],Y
  66.     BPL label_00CAA2 -> BRA label_00CAA2 ;;Anti-DRM Patch change
  67.     AND #$7FFF
  68.     BEQ label_00CABB    ;;END LIMITED START CHECK
  69.  
  70. label_00CAA2:
  71.     LDY #$7FD0
  72.     LDA [$57],Y
  73.     ORA $1447
  74.     STA $1447
  75.     INY
  76.     INY
  77.     LDA [$57],Y
  78.     ORA $1449
  79.     STA $1449
  80.     INC $5A
  81.     BRA label_00CAD4
  82.  
  83. label_00CABB:   ;;Error
  84.     LDA $57
  85.     BNE label_00CAC6
  86.     LDA #$8000
  87.     STA $57
  88.     BRA label_00CA70
  89.  
  90. label_00CAC6:
  91.     SEP #$30
  92.     LDA $1445
  93.     CMP #$FF
  94.     BNE label_00CAD4
  95.     LDA $5A
  96.     STA $1445
  97.  
  98. label_00CAD4:
  99.     SEP #$30
  100.     LDX $5C
  101.     INX
  102.     CPX $1440
  103.     BEQ label_00CAE1
  104.     JMP label_00CA57
  105.  
  106. label_00CAE1:
  107.     LDA $5A
  108.     STA $1444
  109.     PLB
  110.     PLP
  111.     RTL
  112.  
  113. ------------------------get_flash_file_header_5A
  114.     REP #$30
  115.     STZ $5C
  116.     STZ $5E
  117.     LDX #$0000
  118.  
  119. label_00CD29:
  120.     REP #$30
  121.     STZ $57
  122.     SEP #$30
  123.     STX $5B
  124.     TXA
  125.     LSR A
  126.     LSR A
  127.     LSR A
  128.     TAY
  129.     TXA
  130.     AND #$07
  131.     TAX
  132.     LDA $005C,Y
  133.     AND $E9,X
  134.     DEX
  135.     BNE label_00CD9D
  136.  
  137. label_00CD42:
  138.     SEP #$30
  139.     LDX $5B
  140.     LDA $CAF1,X
  141.     STA $59
  142.     REP #$30
  143.     LDY #$7FDC
  144.     LDA [$57],Y
  145.     INY
  146.     INY
  147.     EOR [$57],Y
  148.     CMP #$FFFF
  149.     BNE label_00CD92
  150.     LDY #$7FDA
  151.     LDA [$57],Y
  152.     AND #$00FF
  153.     CMP #$0033
  154.     BNE label_00CD92
  155.     LDY #$7FD4          ;;START LIMITED START CHECK
  156.     LDA [$57],Y
  157.     BPL label_00CD74 -> BRA label_00CD74 ;;Anti-DRM Patch
  158.     AND #$7FFF
  159.     BEQ label_00CD92    ;;END LIMITED START CHECK
  160.  
  161. label_00CD74:
  162.     SEP #$20
  163.     LDA $5A
  164.     BEQ label_00CDA9
  165.     DEC A
  166.     STA $5A
  167.     REP #$20
  168.     LDY #$7FD0
  169.     LDA [$57],Y
  170.     ORA $5C
  171.     STA $5C
  172.     INY
  173.     INY
  174.     LDA [$57],Y
  175.     ORA $5E
  176.     STA $5E
  177.     BRA label_00CD9D
  178.  
  179. label_00CD92:
  180.     LDA $57
  181.     BNE label_00CD9D
  182.     LDA #$8000
  183.     STA $57
  184.     BRA label_00CD42
  185.  
  186. label_00CD9D:
  187.     SEP #$30
  188.     LDX $5B
  189.     INX
  190.     CPX $1440
  191.     BNE label_00CD29
  192.     SEC
  193.     RTL
  194.  
  195. label_00CDA9:
  196.     JSL $105A48
  197.     CLC
  198.     RTL
  199.  
  200. ------------------------search_test_file_header, out:[57]
  201.     PHP
  202.     SEP #$20
  203.     STA $59
  204.     REP #$30
  205.     STZ $57
  206.  
  207. label_00CDCF:
  208.     LDY #$7FDC
  209.     LDA [$57],Y
  210.     INY
  211.     INY
  212.     EOR [$57],Y
  213.     CMP #$FFFF
  214.     BNE label_00CDF4
  215.     LDY #$7FDA
  216.     LDA [$57],Y
  217.     AND #$00FF
  218.     CMP #$00FF
  219.     ;;TYPO?!
  220.     LDY #$7FD4          ;;START LIMITED START CHECK
  221.     LDA [$57],Y
  222.     BPL label_00CDFF -> BRA label_00CDFF ;;Anti-DRM Patch
  223.     AND #$7FFF
  224.     BNE label_00CDFF    ;;END LIMITED START CHECK
  225.  
  226. label_00CDF4:
  227.     LDA $57
  228.     BNE label_00CE02
  229.     LDA #$8000
  230.     STA $57
  231.     BRA label_00CDCF
  232.  
  233. label_00CDFF:
  234.     PLP
  235.     CLC
  236.     RTL
  237.  
  238. label_00CE02:
  239.     PLP
  240.     SEC
  241.     RTL
  242.     PHP
  243.     REP #$30
  244.     LDA $7E99A8
  245.     CMP #$0100
  246.     BNE label_00CE1A
  247.     LDA $7E99AA
  248.     BNE label_00CE1A
  249.     PLP
  250.     CLC
  251.     RTL
  252.  
  253. label_00CE1A:
  254.     PLP
  255.     SEC
  256.     RTL
  257.  
  258. ------------------------decrease_limited_starts
  259.     ;;Can just literally use CLC RTL
  260.     PHP
  261.     REP #$30
  262.     LDY #$7FD4
  263.     LDA [$57],Y
  264.     BPL label_00CEF8 -> BRA label_00CEF8 ;;Anti-DRM Patch
  265.     LDA #$4000
  266.     STA $5A
  267.     LDA [$57],Y
  268.     STA $5C
  269.  
  270. label_00CEA5:
  271.     LDA $5C
  272.     BIT $5A
  273.     BNE label_00CEB2
  274.     LSR $5A
  275.     BCC label_00CEA5
  276.     PLP
  277.     SEC
  278.     RTL
  279.  
  280. label_00CEB2:
  281.     SEP #$20
  282.     LDA $0C5000
  283.     PHA
  284.     LDA $0D5000
  285.     PHA
  286.     LDA #$80
  287.     STA $0C5000
  288.     STA $0D5000
  289.     STA $0E5000
  290.     REP #$20
  291.     LDA $5A
  292.     EOR #$FFFF
  293.     AND [$57],Y
  294.     STA $7E99CA
  295.     SEP #$20
  296.     XBA
  297.     PHA
  298.     XBA
  299.     JSL $105AF4
  300.     PLA
  301.     INY
  302.     JSL $105AF4
  303.     PLA
  304.     STA $0D5000
  305.     PLA
  306.     STA $0C5000
  307.     LDA #$80
  308.     STA $0E5000
  309.  
  310. label_00CEF8:
  311.     PLP
  312.     CLC
  313.     RTL
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top