-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4c4e528
Showing
7 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.smc | ||
*.sfc | ||
|
||
asar.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import sys | ||
import shutil | ||
from subprocess import call | ||
|
||
c = call | ||
|
||
original = "smw.sfc" | ||
out_dir = "patched" | ||
out_file = "smw_segment.sfc" | ||
|
||
|
||
def main(): | ||
if os.path.exists(out_dir): | ||
shutil.rmtree(out_dir) | ||
print("Cleaning output directory.") | ||
os.mkdir(out_dir) | ||
shutil.copy(original, out_dir + "/" + out_file) | ||
c("asar src/main.asm patched/smw_segment.sfc".split()) | ||
print("Assembling finished.") | ||
|
||
|
||
main() | ||
sys.exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
include | ||
|
||
overworld_submap_table: | ||
db $01 ; yoshi's island | ||
db $00 ; donut plains | ||
db $02 ; vanila dome | ||
db $00 ; cheese bridge | ||
db $06 ; star world | ||
db $05 ; special | ||
db $01 ; yoshi island (post special) | ||
db $03 ; forest of illusion | ||
db $00 ; chocolate island | ||
db $00 ; sunken ghost ship | ||
|
||
overworld_pos_x_table: | ||
dw $0068 | ||
dw $0058 | ||
dw $0058 | ||
dw $0118 | ||
dw $0178 | ||
dw $0118 | ||
dw $0068 | ||
dw $0088 | ||
dw $0188 | ||
dw $00E8 | ||
|
||
overworld_pos_y_table: | ||
dw $0278 | ||
dw $0118 | ||
dw $0328 | ||
dw $0078 | ||
dw $0368 | ||
dw $0338 | ||
dw $0278 | ||
dw $0378 | ||
dw $0168 | ||
dw $0178 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
include | ||
|
||
; controller | ||
!mario_byetudlr_hold = $0015 | ||
!mario_byetudlr_frame = $0016 | ||
!mario_axlr_hold = $0017 | ||
!mario_axlr_frame = $0018 | ||
!util_byetudlr_hold = $0DA2 | ||
!util_byetudlr_frame = $0DA6 | ||
!util_axlr_hold = $0DA4 | ||
!util_axlr_frame = $0DA8 | ||
|
||
; stripe image | ||
!stripe_index = $7F837B | ||
!stripe_image = $7F837D | ||
|
||
; overworld | ||
!submap_id = $13C3 | ||
!overworld_pos_x = $1F17 | ||
!overworld_pos_y = $1F19 | ||
|
||
; freeram | ||
!freeram = $0695 ; cleared on reset and titlescreen load | ||
|
||
; test | ||
!test_gm0e = !freeram | ||
|
||
; overworld warp | ||
!warp_index = !freeram+1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include | ||
|
||
; overworld | ||
org $00A165 | ||
jsl gamemode_0e_hijack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
; internal ROM name | ||
org $00FFC0 | ||
db "SMW SEGMENT " | ||
|
||
incsrc "defines.asm" | ||
incsrc "hijacks.asm" | ||
incsrc "overworld.asm" ; $108000 | ||
|
||
org $1FFFFF | ||
db $EA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
include | ||
|
||
org $108000 | ||
gamemode_0e_hijack: | ||
jsl $048241 | ||
; jsr test_gm0e | ||
jsr test_warp | ||
rtl | ||
|
||
test_gm0e: | ||
inc !test_gm0e | ||
rts | ||
|
||
test_warp: | ||
lda !util_byetudlr_hold | ||
and #%00110000 | ||
cmp #%00110000 | ||
beq update_player_position | ||
rts | ||
|
||
update_player_position: | ||
ldx !warp_index | ||
lda.l overworld_submap_table,x | ||
sta !submap_id | ||
sta $1f11 | ||
rep #$20 | ||
txa | ||
asl | ||
tax | ||
lda.l overworld_pos_x_table,x | ||
and #$01FF | ||
sta !overworld_pos_x | ||
lsr #4 | ||
sta $1F1F | ||
lda.l overworld_pos_y_table,x | ||
and #$01FF | ||
sta !overworld_pos_y | ||
lsr #4 | ||
sta $1F21 | ||
sep #$20 | ||
stz $0DD5 | ||
lda #$0B | ||
sta $0100 | ||
rts | ||
|
||
incsrc "data/overworld_table.asm" | ||
|
||
print "[src/overworld.asm]: ", pc, "/109000 inserted" |