Na ja. Sorry, falls ich zu egoistisch rüberkam oder so.
header : lorom
org $0092A2 : db $0C
org $0092EA : db $0C
org $00CB0C : db $0C
org $03C511 : db $0C
org $04DB99 : db $0C
org $05B296 : db $0C
org $0CAB98 : db $0C
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;HDMA Code v3.5
;originally made by BMF.
;Bug fixes and new features added
;Now works with bsnes and snes9x, too!
;by Ice Man
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;JSL to Main Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lorom ;\ ROM is Lorom
header ;| and has a header.
org $0081AA ;| Hack NMI routine and
JSL CodeStart ;| jump to our code.
NOP #4 ;/ 4 time NOP (No Operation)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;HDMA Main Code
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $00FFFF ;| CHANGE THIS TO SOME FREE SPACE!!!!
reset bytes
!CodeSize = CodeEnd-CodeStart ;\
RATS: ;| Write RATS tag to
db "STAR" ;| prevent other programs
dw !CodeSize-$01 ;| from overwriting this
dw !CodeSize-$01^$FFFF ;/ code!
CodeStart:
LDA $0100 ;\ Execute HDMA on
BEQ Start ;/ Nintendo Presents logo
CMP #$05
BEQ Start
CMP #$06
BEQ Start
CMP #$0E ;\ Execute HDMA on
BEQ Start ;/ the overworld
CMP #$0F ;\ Execute HDMA on
BEQ Start ;/ the overworld (fading)
CMP #$10 ;\ Don't execute HDMA
BEQ EndHDMA ;/ on black screens
CMP #$11 ;\ Don't execute HDMA
BEQ EndHDMA ;/ on black screens
CMP #$14 ;\ Execute HDMA in
BEQ Start ;/ the levels
CMP #$17 ;\ Don't execute HDMA
BCS EndHDMA ; | if game mode over 16
RTL ;/ Return
Start:
LDA $7FFF00,x ;\ Load Main HDMA table
BNE Execute ;/ If it isn't equal, execute.
Loop:
TXA ;\ Transfer X to Accumulator
CLC ;| Clear Carry Flag
ADC #$08 ;| and add 08 (for channels).
CMP #$40 ;| If channel is higher then 40,
BCS Return ;| then return and transfer
TAX ;| Accumulator back to X.
BRA Start ;/ Go back to the beginning.
Execute:
ORA $0D9F ;\ Enable HDMA channels
STA $0D9F ;| to actually execute the code.
TXA ;| Transfer X to Accumulator
ASL A ;| Multiply by 2
TAY ;| then transfer Accumulator to Y.
LDA $7FFF01,x ;| Enable DMA Transfer
STA $4300,y ;| at $4300.
LDA $7FFF02,x ;| Set B-Address
STA $4301,y ;| at $4301.
REP #$20 ;| Set processor to 16 Bit
LDA $7FFF03,x ;| Set A-Address (low byte)
STA $4302,y ;| at $4302.
SEP #$20 ;| Set processor to 8 Bit
LDA $7FFF05,x ;| Set A-Address bank
STA $4304,y ;| at $4304.
BRA Loop ;/ Loop the code.
Return:
RTL ;| Return
EndHDMA:
STZ $0D9F ;\ Disable HDMA transfer
LDA #$80 ;| Restore part of the
STA $2100 ;| NMI code because we
STZ $420C ;| JSLed to it
RTL ;/ and return.
CodeEnd:
print bytes
REP #20
LDA $15
EOR #$0F0F
STA $15
SEP #$20