Advertisement
Guest User

safe VSP for mayhem

a guest
Oct 24th, 2020
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. safe VSP channel explained, for mayhem in monsterland release:
  2.  
  3. disk original code:
  4.  
  5. $213d- starts irq stabilization (TSX TXS method)
  6.  
  7. .C:2196 20 82 B1 JSR $B182 ;delay
  8. .C:2199 A0 1B LDY #$1B
  9. .C:219b A9 12 LDA #$12
  10. .C:219d 8D 11 D0 STA $D011 ;rasterline is $50 and cycle is 50 here
  11. .C:21a0 8C 11 D0 STY $D011
  12. .C:21a3 8E 12 D0 STX $D012
  13. .C:21a6 A2 FC LDX #$FC
  14. .C:21a8 9A TXS
  15. .C:21a9 A9 1F LDA #$1F
  16. .C:21ab 8D 18 D0 STA $D018
  17. .C:21ae A9 00 LDA #$00
  18. .C:21b0 A2 06 LDX #$06
  19. .C:21b2 A0 00 LDY #$00
  20. .C:21b4 40 RTI
  21.  
  22. safe VSP mod :
  23.  
  24. .C:2181 A2 1B LDX #$1B ;this is inserted inside irq routine, value is $1B EOR (safe channel #)
  25. .C:2183 A5 10 LDA $10
  26. .C:2185 09 10 ORA #$10
  27. .C:2187 8D 16 D0 STA $D016
  28. .C:218a AD 12 D0 LDA $D012
  29. .C:218d C9 30 CMP #$30
  30. .C:218f F0 00 BEQ $2191
  31. .C:2191 A5 0F LDA $0F
  32. .C:2193 4A LSR A
  33. .C:2194 90 00 BCC $2196
  34. .C:2196 20 82 B1 JSR $B182 ;delay
  35. .C:2199 A0 1B LDY #$1B
  36. .C:219b A9 12 LDA #$12
  37. .C:219d 8D 11 D0 STA $D011 ;like above, rasterline should be $50 and cycle should be 50 here
  38. .C:21a0 8E 11 D0 STX $D011 ;this is inserted for safe VSP
  39. .C:21a3 8C 11 D0 STY $D011
  40.  
  41. so, plot is, rewrite or modify the stable irq routine with adding LDX#$value before (to be stored into $D011) and
  42. between DEC$D011 ($12 here or $1A) and INC$D011 ($1B), store X value into $D011, without breaking the cycle-exact timing.
  43. result is : safe VSP works same as LFT's VSP-LAB release (first introduced in his SAFE VSP demo).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement