geschrieben am 12.11.2010 22:07:06 in Ideenrunde (ERSTEN POST LESEN, SONST STERBT IHR!)
(
Link
)
; von KilloZapit
; Verhindert, dass bei Layer-3-Hintergründen,
; die hinter Layer 2 erscheinen, die Statusleiste
; auch in den Hintergrund tritt
header
lorom
org $008292
JML PreStatusBar : NOP : NOP
org $0083AD
JML PostStatusBar : NOP
!LevelNum = $010B
!blockaddress = $288000
org !blockaddress ; address to put code
; -------------------------------------------
db "STAR" ; Write RATS tag
dw Endcodeblock-Startcodeblock
dw Endcodeblock-Startcodeblock^$FFFF
; -------------------------------------------
Startcodeblock: ; code starts here
; -------------------------------------------
; Set Status Bar Scroll/Screen/Ect
PreStatusBar:
; old
;LDY.b #$24 ; Scanline-Anzahl
REP #$10 ; \ Da sich der Patch mit
LDX !LevelNum ; | Ersanios Scanline-Hack
LDA.l IRQTable,x; | überschneidet, wird der hier
SEP #$10 ; | mit eingefügt, d.h. das originale
TAY ; | LDY #$24 durch seinen Code zum Ändern
LDA $4211 ; / auf Level-Basis ersetzt
STY $4209
STZ $420A
STZ $11
LDA.b #$A1
STA $4200
STZ $2111
STZ $2111
; new
STZ $2112
STZ $2112
; Force status bar in main screen
LDA $0D9D
ORA.b #$04
STA $212c
; set level's Sub Screen
LDA $0D9E
STA $212d
; return to NMI
JML $8082B0
PostStatusBar:
; Set level's CGADSUB
LDA $40
STA $2131
; restore level's normal Main Screen
LDA $0D9D
STA $212c
; return to IRQ handler
JML $8083B2
IRQTable: db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 00-07
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 08-0F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 10-17
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 18-1F
db $24,$24,$24,$24,$24,$00,$00,$00 ;Levels 20-27
db $00,$00,$00,$00,$00,$00,$00,$00 ;Levels 28-2F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 30-37
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 38-3F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 40-47
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 48-4F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 50-57
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 58-5F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 60-67
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 68-6F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 70-77
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 78-7F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 80-87
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 88-8F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 90-97
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 98-9F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels A0-A7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels A8-AF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels B0-B7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels B8-BF
db $24,$24,$24,$24,$24,$00,$24,$24 ;Levels C0-C7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels C8-CF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels D0-D7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels D8-DF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels E0-E7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels E8-EF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels F0-F7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels F8-FF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 100-107
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 108-10F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 110-117
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 118-11F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 120-127
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 128-12F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 130-137
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 138-13F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 140-147
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 148-14F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 150-157
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 158-15F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 160-167
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 168-16F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 170-177
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 178-17F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 180-187
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 188-18F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 190-197
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 198-19F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1A0-1A7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1A8-1AF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1B0-1B7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1B8-1BF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1C0-1C7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1C8-1CF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1D0-1D7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1D8-1DF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1E0-1E7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1E8-1EF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1F0-1F7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1F8-1FF
; -------------------------------------------
Endcodeblock: ; code ends here
; -------------------------------------------
;so benutze ich's
LDA.b #%00010001; \
STA.w $0D9D ; | Layer 3 in den Subscreen,
LDA.b #%00000110; | alles andere in den Mainscreen
STA.w $0D9E ; /
lorom
header
!MainCodeLocation = $1E8000 ;Point it to some free space
!FreeRAM = $7007FF
!MAIN_CODE_SIZE = END_OF_FILE-AddressTable
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $00807C
JSL SPCUpload1
NOP #$2
org $00808D
JSL SPCUpload2
org $008096
JSL SPCUpload2
org $0080B4
JSL SPCUpload2
JSL SPCUpload2
TAX
JSL SPCUpload3
NOP #$3
org $008F65
JSL Bonus
NOP
org $009702
NOP #$3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $00973B
NOP #$5
JSL CustomMusicMain
NOP #$2
org $00A1C7
JSL ClearRAM
org $00A64A
LDA $0DDA
AND #$7F
JSL HackingRoutine
NOP
org $05855F
BRA $02
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org !MainCodeLocation
db "STAR"
dw !MAIN_CODE_SIZE-$01
dw !MAIN_CODE_SIZE-$01^$FFFF
db $03 ;code version, for removing or modifying this main code in the future.
AddressTable: dl $000000,$000000,$000000,$000000 ; 20-23, 24-27, 28-2B, 2C-2F
dl $000000,$000000,$000000,$000000 ; 30-33, 34-37, 38-3B, 3C-3F
dl $000000,$000000,$000000,$000000 ; 40-43, 44-47, 48-4B, 4C-4F
dl $000000,$000000,$000000,$000000 ; 50-53, 54-57, 58-5B, 5C-5F
dl $000000,$000000,$000000,$000000 ; 60-63, 64-67, 68-6B, 6C-6F
dl $000000,$000000,$000000,$000000 ; 70-73, 74-77, 78-7B, 7C-7F
dl $000000,$000000,$000000,$000000 ; 80-83, 84-87, 88-8B, 8C-8F
dl $000000,$000000,$000000,$000000 ; 90-93, 94-97, 98-9B, 9C-9F
CustomMusicMain: STZ $0DAE
STZ $0DAF
LDA $0100
CMP #$11
BNE Return
LDA $0DDA
CMP !FreeRAM
CLC
BEQ ActualNumber
STA !FreeRAM
CMP #$20
BCC UploadLevel
CustomMusic: REP #$30
AND #$00FF
LSR A
LSR A
STA $00
ASL A
ADC $00
TAX
LDA AddressTable-$18,x
PHA
LDA AddressTable-$18+$01,x
STA $04
LDA #$8000
STA $00
SEP #$30
LDA #$00
PHK
PER $0006
PEA $804C
JML $80811A
REP #$20
PLA
STA $00
SEP #$20
LDX #$1D
.wait DEX
BNE .wait
LDA $05
PHK
PER $0006
PEA $804C
JML $80811A
SEC
ActualNumber: LDA $0DDA
BIT #$E0
BEQ Clear1DFB
AND #$03
INC A
ORA #$20
STA $0DDA
BCS StoreTo1DFB
Clear1DFB: LDA #$00
StoreTo1DFB: STA $1DFB
Return: RTL
UploadLevel: PHK
PER $0006
PEA $804C
JML $008148
LDA $0DDA
BRA StoreTo1DFB
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
HackingRoutine: AND #$3F
STA $0DDA
LDA #$FF
STA !FreeRAM
RTL
ClearRAM: LDA #$FF
STA !FreeRAM
JML $848241
Bonus: LDA #$FF
STA !FreeRAM
STA $1425
RTL
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SPCUpload1: LDA $00
AND #$7FFF
TAY
LDA #$8000
STA $00
LDA #$BBAA
RTL
SPCUpload2: LDA [$00],y
INY
BPL .R
LDY #$0000
INC $02
.R XBA
RTL
SPCUpload3: JSL SPCUpload2
JSL SPCUpload2
STA $2142
XBA
STA $2143
RTL
END_OF_FILE:
lorom
header
;patch this to your ROM ONLY IF you don't use -se option of AddMusic.
;Because, AddMusic inserts MORE.bin (if it is in the same directory as AddMusic) automatically
;when you use -se option.
!MainCodeLocation = $258000 ;Point it to some free space!
!MAIN_CODE_SIZE = END_OF_FILE-CodeStart
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org $008055
JML UploadData
NOP
NOP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org !MainCodeLocation
db "STAR"
dw !MAIN_CODE_SIZE-$01
dw !MAIN_CODE_SIZE-$01^$FFFF
CodeStart:
UploadData: STZ $0100
STZ $0109
REP #$10
LDX #$0000
Wait: DEX
BNE Wait
SEP #$30
LDA.b #CodeStart
STA $00
LDA.b #CodeStart/$0100
STA $01
LDA.b #CodeStart/$010000
STA $02
PEA $805A
JML $80811D
incbin MORE.bin
db $00,$00,$00,$05
END_OF_FILE:
; von KilloZapit
; Verhindert, dass bei Layer-3-Hintergründen,
; die hinter Layer 2 erscheinen, die Statusleiste
; auch in den Hintergrund tritt
header
lorom
org $008292
JML PreStatusBar : NOP : NOP
org $0083AD
JML PostStatusBar : NOP
!LevelNum = $010B
!blockaddress = $258000
org !blockaddress ; address to put code
; -------------------------------------------
db "STAR" ; Write RATS tag
dw Endcodeblock-Startcodeblock
dw Endcodeblock-Startcodeblock^$FFFF
; -------------------------------------------
Startcodeblock: ; code starts here
; -------------------------------------------
; Set Status Bar Scroll/Screen/Ect
PreStatusBar:
; old
;LDY.b #$24 ; Scanline-Anzahl
REP #$10 ; \ Da sich der Patch mit
LDX !LevelNum ; | Ersanios Scanline-Hack
LDA.l IRQTable,x; | überschneidet, wird der hier
SEP #$10 ; | mit eingefügt, d.h. das originale
TAY ; | LDY #$24 durch seinen Code zum Ändern
LDA $4211 ; / auf Level-Basis ersetzt
STY $4209
STZ $420A
STZ $11
LDA.b #$A1
STA $4200
STZ $2111
STZ $2111
; new
STZ $2112
STZ $2112
; Force status bar in main screen
LDA $0D9D
ORA $0D9E
AND #$04
BNE +
JML $808297
+
LDA $0D9D
ORA.b #$04
STA $212c
; set level's Sub Screen
LDA $0D9E
STA $212d
; return to NMI
JML $8082B0
PostStatusBar:
; Set level's CGADSUB
LDA $40
STA $2131
; restore level's normal Main Screen
LDA $0D9D
ORA $0D9E
AND #$04
BNE +
JML $8083B2
+
LDA $0D9D
STA $212c
; return to IRQ handler
JML $8083B2
IRQTable: db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 00-07
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 08-0F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 10-17
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 18-1F
db $24,$24,$24,$24,$24,$00,$00,$00 ;Levels 20-27
db $00,$00,$00,$00,$00,$00,$00,$00 ;Levels 28-2F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 30-37
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 38-3F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 40-47
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 48-4F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 50-57
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 58-5F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 60-67
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 68-6F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 70-77
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 78-7F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 80-87
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 88-8F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 90-97
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 98-9F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels A0-A7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels A8-AF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels B0-B7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels B8-BF
db $24,$24,$24,$24,$24,$00,$24,$24 ;Levels C0-C7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels C8-CF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels D0-D7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels D8-DF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels E0-E7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels E8-EF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels F0-F7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels F8-FF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 100-107
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 108-10F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 110-117
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 118-11F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 120-127
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 128-12F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 130-137
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 138-13F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 140-147
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 148-14F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 150-157
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 158-15F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 160-167
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 168-16F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 170-177
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 178-17F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 180-187
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 188-18F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 190-197
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 198-19F
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1A0-1A7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1A8-1AF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1B0-1B7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1B8-1BF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1C0-1C7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1C8-1CF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1D0-1D7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1D8-1DF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1E0-1E7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1E8-1EF
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1F0-1F7
db $24,$24,$24,$24,$24,$24,$24,$24 ;Levels 1F8-1FF
; -------------------------------------------
Endcodeblock: ; code ends here
; -------------------------------------------