Skip to content

Instantly share code, notes, and snippets.

@LuigiBlood
Created January 30, 2024 23:19
Show Gist options
  • Save LuigiBlood/120729317e9714624a9a40743f393ef1 to your computer and use it in GitHub Desktop.
Save LuigiBlood/120729317e9714624a9a40743f393ef1 to your computer and use it in GitHub Desktop.
Solar Magic Advance 0.1 Source Code
'Super Mario Advance 4 eCard Maker
'Solar Magic Advance by LuigiBlood
'version 0.1
'Liberty BASIC v4.03
nomainwin
'Powerup List Array
DIM pwrup$(14)
pwrup$(0)="Mushroom"
pwrup$(1)="Fire Flower"
pwrup$(2)="Leaf"
pwrup$(3)="Frog Suit"
pwrup$(4)="Tanooki Suit"
pwrup$(5)="Hammer Suit"
pwrup$(6)="Cloud"
pwrup$(7)="P-Wing"
pwrup$(8)="Star"
pwrup$(9)="Anchor"
pwrup$(10)="Hammer"
pwrup$(11)="Warp Whistle"
pwrup$(12)="Music Box"
pwrup$(13)="Cape Feather (SMW)"
pwrup$(14)="Boomerang"
'SwitchColor Array
DIM swicolor$(6)
swicolor$(0)="Blue"
swicolor$(1)="Orange"
swicolor$(2)="Green-Blue"
swicolor$(3)="Yellow"
swicolor$(4)="Green"
swicolor$(5)="Cyan"
swicolor$(6)="Red"
'SwitchEffects Array
DIM swieffects$(15)
swieffects$(0)="1ups replaced with 3ups Moon"
swieffects$(1)="Slow Down the Timer"
swieffects$(2)="Double Scores on Everything"
swieffects$(3)="1/2 Power Meter"
swieffects$(4)="Flying platforms saves you from dying twice"
swieffects$(5)="Add grass on levels (SMB2 Style)"
swieffects$(6)="Turn Enemies into Coins (SMW Style)"
swieffects$(7)="Low Gravity Luigi"
swieffects$(8)="Nothing"
swieffects$(9)="Enemies replaced by harder ones"
swieffects$(10)="Nothing"
swieffects$(11)="Nothing"
swieffects$(12)="Nothing"
swieffects$(13)="Nothing"
swieffects$(14)="Nothing"
swieffects$(15)="Random Item Box (SMW Style)"
'GUI Solar Magic Advance 0.1
'Compressed Level Data MAX = 1990 bytes.
WindowWidth = 300
WindowHeight = 300
MENU #solar, "File", "New e-Level...", [wait], "Load a e-Level (Check)...", [LoadELevel], "Save a e-Level...", [wait], | , "Create Level Card...", [wait], | , "Exit", [quitsolar]
MENU #solar, "Edit", "Choose Room...", [wait], "Choose Mode...", [wait], | , "Edit Header...", [wait]
MENU #solar, "eCards", "New Power-Up Card...", [PowerUpEdit], "New Switch Card...", [SwitchEdit], "New Demo Card...", [DemoEdit]
'BMPBUTTON #solar.new, "BMP\NewLevel.bmp", [wait], UL, 2, 0
'BMPBUTTON #solar.open, "BMP\OpenLevel.bmp", [LoadELevel], UL, 20, 0
'BMPBUTTON #solar.save, "BMP\SaveLevel.bmp", [wait], UL, 38, 0
'BMPBUTTON #solar.make, "BMP\MakeCard.bmp", [wait], UL, 58, 0
'BMPBUTTON #solar.pwrup, "BMP\PowerUpCard.bmp", [PowerUpEdit], UL, 2+20*4-4, 0
'BMPBUTTON #solar.switch, "BMP\SwitchCard.bmp", [SwitchEdit], UL, 20+20*4-4, 0
'BMPBUTTON #solar.demo, "BMP\DemoCard.bmp", [DemoEdit], UL, 38+20*4-4, 0
'graphicbox #solar.lvl, 1, 19, WindowWidth-2, WindowHeight - 20
'graphicbox #solar.lvl, 1, 19, 290, 230
open "Solar Magic Advance 0.1 (eCard Maker)" for graphics as #solar
'print #solar, "resizehandler [resize]"
print #solar, "trapclose [quitsolar]"
wait
[LoadELevel]
filedialog "Open eLevel File (Uncompressed)...", "*.level", eLevelFile$
if eLevelFile$ = "" then wait
open eLevelFile$ for binary as #eLevel
'seek #eLevel, 0
if input$(#eLevel, 1) = chr$(0) then
notice "This eLevel have no eCoin."
else
notice "This eLevel have a eCoin."
end if
if input$(#eLevel, 1) = chr$(0) then
notice "This eLevel have no Ace Coins."
else
seek #eLevel, 1
'input #eLevel, ACoins$
notice "This eLevel have ";ASC(input$(#eLevel, 1));" Ace Coin(s)."
end if
if input$(#eLevel, 1) = chr$(1) then
notice "This eLevel is Star Class."
else
seek #eLevel, 2
if input$(#eLevel, 1) = chr$(2) then
notice "This eLevel is Mushroom Class."
else
seek #eLevel, 2
if input$(#eLevel, 1) = chr$(3) then
notice "This eLevel is Flower Class (Unused)."
else
seek #eLevel, 2
if input$(#eLevel, 1) = chr$(hexdec("1f")) then
notice "This eLevel is Promotional Class."
else
notice "This eLevel Class is Unknown."
end if
end if
end if
end if
Notice "This eLevel Number is : "; ASC(input$(#eLevel, 1))
notice "eLevel Icon Number : "; dechex$(ASC(input$(#eLevel, 1)))
pointer.objects=ASC(input$(#eLevel, 1))+ASC(input$(#eLevel, 1))*hexdec("100")
seek #eLevel, pointer.objects+11
object1.bank=ASC(input$(#eLevel, 1))
object1.posy=ASC(input$(#eLevel, 1))
object1.posx=ASC(input$(#eLevel, 1))
object1.type=ASC(input$(#eLevel, 1))
if object1.type = hexdec("0b") then object1.second=ASC(input$(#eLevel, 1))
loadbmp str$(object1.bank/hexdec("10"));"-";dechex$(object1.type), "BMP\OBJ\";str$(object1.bank/hexdec("10"));"-";dechex$(object1.type);".bmp"
print #solar, "drawbmp ";str$(object1.bank/hexdec("10"));"-";dechex$(object1.type);" "; object1.posx*16; " "; object1.posy*16
close #eLevel
wait
[resize]
print #solar.lvl, "locate 1 19 ";WindowWidth-2;" ";WindowHeight-20
print #solar.lvl, "autoresize"
print #solar, "refresh"
wait
[quitsolar]
close #solar
end
[PowerUpEdit]
WindowWidth = 300
WindowHeight = 210
BUTTON #maker.quit, " Quit ", [quitPWR], LR, 52, 5
BUTTON #maker.makecrd, "Make the card !", [makecrd], LL, 82, 0-11
STATICTEXT #maker, "Card Identifier (0-255) :", 75, 8, 107, 15
TEXTBOX #maker.crdID, 185, 5, 30, 20
GROUPBOX #maker.pwrupgrp, "Power-up Card", 5, 32, 270+13, 72-10
RADIOBUTTON #maker.item, "Item :", [pwrupitemradio], [wait], 5+10, 45+5, 44, 15
COMBOBOX #maker.pwrup, pwrup$(), [pwrup], 5+10+30+15, 60-13, 125, 15
RADIOBUTTON #maker.1up, "1-ups (1-255) :", [pwrup1upradio], [wait], 5+10, 45+5+22, 44+15+25, 15
TEXTBOX #maker.oneUP, 75+10+17, 82-12, 30, 20
BUTTON #maker.manyitem, "Multi Item Card", [MultiItemWin], UR, -23, 50, 80, 30
GROUPBOX #maker.regiongrp, "Region:", 188+38, 150+15-70, 62, 50
RADIOBUTTON #maker.regUS, "US", [US], [wait], 192+38, 165+15-70, 30, 15
RADIOBUTTON #maker.regJA, "Japan+", [Jap], [wait], 192+38, 180+15-70, 52, 15
GROUPBOX #maker.other, "Other:", 130, 150+15-70, 62+30, 40
CHECKBOX #maker.eWorldDeny, "Deny World-e", [eWorldDenyYES], [eWorldDenyNO], 135, 180-70, 85, 15
open "New Power-Up Card..." for window_nf as #maker
print #maker, "trapclose [quitPWR]"
print #maker.pwrup, "selectindex 1"
print #maker.item, "set"
print #maker.oneUP, "1"
print #maker.oneUP, "!disable"
print #maker.regUS, "set"
print #maker.crdID, "0"
pwrupchoose=0
region=0
CARDMAKE=0
DenyE=0
wait
[quitPWR]
close #maker
wait
[SwitchEdit]
WindowWidth = 300
WindowHeight = 210
BUTTON #maker.quit, " Quit ", [quitPWR], LR, 52, 5
BUTTON #maker.makecrd, "Make the card !", [makecrd], LL, 82, 0-11
BUTTON #maker.multi, "Multi Effects", [MultiSwitch], LL, 5, 40
STATICTEXT #maker, "Card Identifier (0-255) :", 75, 8, 107, 15
TEXTBOX #maker.crdID, 185, 5, 30, 20
GROUPBOX #maker.switchgrp, "Switch Card", 5, 100-70, 270+13, 72-25+15
STATICTEXT #maker, "Switch Color :", 10, 130-10-1-2-70, 70, 15
COMBOBOX #maker.swicolor, swicolor$(), [wait], 80, 130-10-5-2-70, 80, 15
STATICTEXT #maker, "Effect :", 10, 130-10-1+19-70, 35, 15
COMBOBOX #maker.swieffect, swieffects$(), [wait], 80-35, 130-10-5-2+20-70, 240, 15
GROUPBOX #maker.regiongrp, "Region:", 188+38, 150+15-70, 62, 50
RADIOBUTTON #maker.regUS, "US", [US], [wait], 192+38, 165+15-70, 30, 15
RADIOBUTTON #maker.regJA, "Japan+", [Jap], [wait], 192+38, 180+15-70, 52, 15
GROUPBOX #maker.other, "Other:", 130, 150+15-70, 62+30, 40
CHECKBOX #maker.eWorldDeny, "Deny World-e", [eWorldDenyYES], [eWorldDenyNO], 135, 180-70, 85, 15
open "New Switch Card..." for window_nf as #maker
print #maker, "trapclose [quitPWR]"
region=0
CARDMAKE=1
DenyE=0
print #maker.swicolor, "selectindex 1"
print #maker.swieffect, "selectindex 1"
print #maker.regUS, "set"
print #maker.crdID, "0"
wait
[MultiSwitch]
WindowWidth = 350
WindowHeight = 260
BUTTON #multi.quit, " Quit ", [QuitMulti], LR, 52, 5
BUTTON #multi.makecrd, "Make the card !", [makemultieff], LL, 82, 0-11
STATICTEXT #multi, "Card Identifier (0-255) :", 75+100, 8-1, 107, 15
TEXTBOX #multi.crdID, 185+100, 5-1, 30, 20
STATICTEXT #multi, "Switch Color :", 10, 130-10-1-2-70-40, 70, 15
COMBOBOX #multi.swicolor, swicolor$(), [wait], 80, 130-10-5-2-70-40, 80, 15
GROUPBOX #multi.regiongrp, "Region:", 188+38+50, 25, 62, 50
RADIOBUTTON #multi.regUS, "US", [USm], [wait], 192+38+50, 165-150+25, 30, 15
RADIOBUTTON #multi.regJA, "Japan+", [Japm], [wait], 192+38+50, 180-150+25, 52, 15
GROUPBOX #multi.other, "Other:", 130+50, 25, 62+30, 40
CHECKBOX #multi.eWorldDeny, "Deny World-e", [eWorldDenyYES], [eWorldDenyNO], 135+50, 165-150+25, 85, 15
CHECKBOX #multi.effect0, swieffects$(0), [Effect0ON], [Effect0OFF], 10, 165-150+25-15, 162, 15
CHECKBOX #multi.effect1, swieffects$(1), [Effect1ON], [Effect1OFF], 10, 165-150+25, 162, 15
CHECKBOX #multi.effect2, swieffects$(2), [Effect2ON], [Effect2OFF], 10, 165-150+25+15, 162, 15
CHECKBOX #multi.effect3, swieffects$(3), [Effect3ON], [Effect3OFF], 10, 165-150+40+15, 162, 15
CHECKBOX #multi.effect4, swieffects$(4), [Effect4ON], [Effect4OFF], 10, 165-150+40+30, 162+60, 15
CHECKBOX #multi.effect5, swieffects$(5), [Effect5ON], [Effect5OFF], 10, 165-150+40+45, 162+35, 15
CHECKBOX #multi.effect6, swieffects$(6), [Effect6ON], [Effect6OFF], 10, 165-150+85+15, 162+35, 15
CHECKBOX #multi.effect7, swieffects$(7), [Effect7ON], [Effect7OFF], 10, 165-150+100+15, 162, 15
CHECKBOX #multi.effect9, swieffects$(9), [Effect9ON], [Effect9OFF], 10, 165-150+115+20, 162+20, 15
CHECKBOX #multi.effect15, swieffects$(15), [Effect15ON], [Effect15OFF], 10, 165-150+135+20, 162, 15
open "Multi Effects (Switch Card)" for window_nf as #multi
print #multi, "trapclose [QuitMulti]"
print #multi.swicolor, "selectindex 1"
print #multi.regUS, "set"
print #multi.crdID, "0"
regionm=0
DenyE=0
NumEffects=0
Effect0=0
Effect1=0
Effect2=0
Effect3=0
Effect4=0
Effect5=0
Effect6=0
Effect7=0
Effect9=0
Effect15=0
wait
'ON EFFECTS
[Effect0ON]
NumEffects=NumEffects+1
Effect0=1
wait
[Effect1ON]
NumEffects=NumEffects+1
Effect1=1
wait
[Effect2ON]
NumEffects=NumEffects+1
Effect2=1
wait
[Effect3ON]
NumEffects=NumEffects+1
Effect3=1
wait
[Effect4ON]
NumEffects=NumEffects+1
Effect4=1
wait
[Effect5ON]
NumEffects=NumEffects+1
Effect5=1
wait
[Effect6ON]
NumEffects=NumEffects+1
Effect6=1
wait
[Effect7ON]
NumEffects=NumEffects+1
Effect7=1
wait
[Effect9ON]
NumEffects=NumEffects+1
Effect9=1
wait
[Effect15ON]
NumEffects=NumEffects+1
Effect15=1
wait
'OFF EFFECTS
[Effect0OFF]
NumEffects=NumEffects-1
Effect0=0
wait
[Effect1OFF]
NumEffects=NumEffects-1
Effect1=0
wait
[Effect2OFF]
NumEffects=NumEffects-1
Effect2=0
wait
[Effect3OFF]
NumEffects=NumEffects-1
Effect3=0
wait
[Effect4OFF]
NumEffects=NumEffects-1
Effect4=0
wait
[Effect5OFF]
NumEffects=NumEffects-1
Effect5=0
wait
[Effect6OFF]
NumEffects=NumEffects-1
Effect6=0
wait
[Effect7OFF]
NumEffects=NumEffects-1
Effect7=0
wait
[Effect9OFF]
NumEffects=NumEffects-1
Effect9=0
wait
[Effect15OFF]
NumEffects=NumEffects-1
Effect15=0
wait
[DemoEdit]
WindowWidth = 300
WindowHeight = 210
BUTTON #maker.quit, " Quit ", [quitPWR], LR, 52, 5
BUTTON #maker.makecrd, "Make the card !", [makecrd], LL, 82, 0-11
STATICTEXT #maker, "Card Identifier (0-255) :", 75, 8, 107, 15
TEXTBOX #maker.crdID, 185, 5, 30, 20
GROUPBOX #maker.regiongrp, "Region:", 188+38, 150+15-70, 62, 50
RADIOBUTTON #maker.regUS, "US", [US], [wait], 192+38, 165+15-70, 30, 15
RADIOBUTTON #maker.regJA, "Japan+", [Jap], [wait], 192+38, 180+15-70, 52, 15
GROUPBOX #maker.other, "Other:", 130, 150+15-70, 62+30, 40
CHECKBOX #maker.eWorldDeny, "Super Replay", [SuperDemoYES], [SuperDemoNO], 135, 180-70, 85, 15
GROUPBOX #maker.switchgrp, "Save Slot", 5, 100-70, 80, 72-25+15+18
RADIOBUTTON #maker.file1, "File 1", [File1Choose], [wait], 5+5, 45, 44, 15
RADIOBUTTON #maker.file2, "File 2", [File2Choose], [wait], 5+5, 45+15, 44, 15
RADIOBUTTON #maker.file3, "File 3", [File3Choose], [wait], 5+5, 45+30, 44, 15
RADIOBUTTON #maker.file4, "Level Card", [File4Choose], [wait], 5+5, 45+45, 70, 15
GROUPBOX #maker.switchgrp, "Replay Slot", 86, 100-70, 70, 72-25+5
RADIOBUTTON #maker.demo1, "Replay 1", [Demo1Choose], [wait], 5+5+80, 45, 65, 15
RADIOBUTTON #maker.demo2, "Replay 2", [Demo2Choose], [wait], 5+5+80, 45+15, 65, 15
open "New Demo Card..." for window_nf as #maker
region=0
CARDMAKE=2
SuperDemo=0
DenyE=0
FileSlot=1
DemoSlot=1
print #maker.regUS, "set"
print #maker.file1, "set"
print #maker.demo1, "set"
print #maker.crdID, "0"
wait
[File1Choose]
'Doc File 1 Replay 1 : 0x1c006
'Doc File 1 Replay 2 : 0x1c800
'Differences/Size : 0x7FA, 2042
FileSlot=1
wait
[File2Choose]
'Doc File 2 Replay 1 : 0x1d006
'Doc File 2 Replay 2 : 0x1d800
FileSlot=2
wait
[File3Choose]
'Doc File 3 Replay 1 : 0x1e006
'Doc File 3 Replay 2 : 0x1e800
FileSlot=3
wait
[File4Choose]
'Doc Level Card Replay 1 : 0x1f006
'Doc Level Card Replay 2 : 0x1f800
FileSlot=4
wait
[Demo1Choose]
DemoSlot=1
wait
[Demo2Choose]
DemoSlot=2
wait
[SuperDemoYES]
SuperDemo=1
wait
[SuperDemoNO]
SuperDemo=0
wait
[quit]
close #maker
print "Program Stopped."
end
[eWorldDenyYES]
DenyE=1
wait
[eWorldDenyNO]
DenyE=0
wait
[ChooseMAKPWR]
CARDMAKE=0
print #maker.swicolor, "disable"
print #maker.swieffect, "disable"
print #maker.item, "enable"
print #maker.1up, "enable"
if pwrupchoose=0 then
gosub [pwrupitemradio]
else
gosub [pwrup1upradio]
end if
wait
[ChooseMAKSWI]
CARDMAKE=1
print #maker.swicolor, "enable"
print #maker.swieffect, "enable"
print #maker.item, "disable"
print #maker.1up, "disable"
if pwrupchoose=0 then
print #maker.pwrup, "disable"
else
print #maker.oneUP, "!disable"
end if
wait
[wait]
wait
[pwrup]
wait
[pwrupitemradio]
pwrupchoose=0
print #maker.oneUP, "!disable"
print #maker.pwrup, "enable"
wait
[pwrup1upradio]
pwrupchoose=1
print #maker.oneUP, "!enable"
print #maker.pwrup, "disable"
wait
[US]
region=0
wait
[Jap]
region=1
wait
[makecrd]
if CARDMAKE=2 then
filedialog "Load SMA4 SAV File...", "*.sav", SAVfile$
if SAVfile$ = "" then
wait
end if
end if
filedialog "Save SMA4 Card...", "*.bin", fileName$
if fileName$ <> "" then
print "Création du fichier..."
print #maker.crdID, "!contents? crdID$";
if crdID$="" then crdID$="0"
if CARDMAKE=0 then
if pwrupchoose=0 then
print #maker.pwrup, "selectionindex? makpwr$"
print makpwr$
gosub [MAKEPWRCARD]
end if
if pwrupchoose=1 then
print #maker.oneUP, "!contents? makpwr$"
print makpwr$
if val(makpwr$)>255 then
notice "Change your 1up numbers, not more than 255."
wait
else
gosub [MAKELIFECARD]
end if
end if
end if
if CARDMAKE=1 then
print #maker.swicolor, "selectionindex? makpwr$"
print #maker.swieffect, "selectionindex? makpwr2$"
gosub [MAKESWITCHCARD]
end if
if CARDMAKE=2 then
gosub [MAKEDEMOCARD]
wait
end if
wait
else
wait
end if
[MAKEPWRCARD]
open fileName$ for binary as #card
print "Fichier Crée"
print #card, chr$(hexdec("71")+region)+chr$(hexdec("F0"))+chr$(hexdec("10"))+chr$(hexdec("18"))+chr$(hexdec("22"))+chr$(hexdec("1a"))+chr$(0)+chr$(hexdec("02"))+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(val(crdID$))+chr$(6)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(1)+chr$(0)+chr$(DenyE)+chr$(val(makpwr$))
print "Insertion du header."
fill=hexdec("0f")
while loc(#card) < 2076
print #card, chr$(fill)
fill=fill+1
if fill = 256 then fill=0
wend
close #card
print "Terminé."
notice "Creating Power-up Card (Item) is a success."
wait
[MAKELIFECARD]
open fileName$ for binary as #card
print "Fichier Crée"
print #card, chr$(hexdec("71")+region)+chr$(hexdec("F0"))+chr$(hexdec("10"))+chr$(hexdec("18"))+chr$(hexdec("22"))+chr$(hexdec("18"))+chr$(0)+chr$(hexdec("02"))+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(val(crdID$))+chr$(6)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(1)+chr$(val(makpwr$))+chr$(0)+chr$(DenyE)
print "Insertion du header."
fill=hexdec("0e")
while loc(#card) < 2076
print #card, chr$(fill)
fill=fill+1
if fill = 256 then fill=0
wend
close #card
print "Terminé."
notice "Creating Power-up Card (1ups) is a success."
wait
[MAKESWITCHCARD]
open fileName$ for binary as #card
print "Fichier Crée"
print #card, chr$(hexdec("71")+region)+chr$(hexdec("F0"))+chr$(hexdec("10"))+chr$(hexdec("18"))+chr$(hexdec("22"))+chr$(hexdec("1a"))+chr$(0)+chr$(hexdec("02"))+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(val(crdID$))+chr$(6)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(val(makpwr$)+1)+chr$(1)+chr$(0)+chr$(DenyE)+chr$(val(makpwr2$)-1)
print "Insertion du header."
fill=hexdec("0f")
while loc(#card) < 2076
print #card, chr$(fill)
fill=fill+1
if fill = 256 then fill=0
wend
close #card
print "Terminé."
notice "Creating Switch Card is a success."
wait
[MAKEDEMOCARD]
'Doc File 1 Replay 1 : 0x1c006
'Doc File 1 Replay 2 : 0x1c800
'Differences : 0x7FA, 2042
'Size:2042-57=1985
'Doc File 2 Replay 1 : 0x1d006
'Doc File 2 Replay 2 : 0x1d800
'Doc File 3 Replay 1 : 0x1e006
'Doc File 3 Replay 2 : 0x1e800
'Doc Level Card Replay 1 : 0x1f006
'Doc Level Card Replay 2 : 0x1f800
'D8EC 28 20
open SAVfile$ for binary as #SAVE
open fileName$ for binary as #card
print #card, chr$(hexdec("71")+region)+chr$(hexdec("F0"))+chr$(hexdec("20"))+chr$(hexdec("20"))+chr$(hexdec("22"))+chr$(hexdec("cc"))+chr$(0)+chr$(hexdec("02"))+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(val(crdID$))+chr$(8)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(SuperDemo)+chr$(1)+chr$(0)+chr$(DenyE)
Demo$=""
endSAV$="ÿÿ"
'FileSlot=1
'DemoSlot=1
demolength=0
if FileSlot=1 then
if DemoSlot=1 then
for demo1=0 to 1985
SEEK #SAVE, hexdec("1c006")+demo1
'Input #SAVE, Demo$
Demo$=Demo$+input$(#SAVE, 1)
demolength=demolength+1
if input$(#SAVE, 2)=endSAV$ then
demolength=demolength+2
exit for
end if
next
end if
if DemoSlot=2 then
for demo1=0 to 1985
SEEK #SAVE, hexdec("1c800")+demo1
Demo$=Demo$+input$(#SAVE, 1)
demolength=demolength+1
if input$(#SAVE, 2)=endSAV$ then
demolength=demolength+2
exit for
end if
next
end if
end if
if FileSlot=2 then
if DemoSlot=1 then
for demo1=0 to 1985
SEEK #SAVE, hexdec("1d006")+demo1
'Input #SAVE, Demo$
Demo$=Demo$+input$(#SAVE, 1)
demolength=demolength+1
if input$(#SAVE, 2)=endSAV$ then
demolength=demolength+2
exit for
end if
next
end if
if DemoSlot=2 then
for demo1=0 to 1985
SEEK #SAVE, hexdec("1d800")+demo1
Demo$=Demo$+input$(#SAVE, 1)
demolength=demolength+1
if input$(#SAVE, 2)=endSAV$ then
demolength=demolength+2
exit for
end if
next
end if
end if
if FileSlot=3 then
if DemoSlot=1 then
for demo1=0 to 1985
SEEK #SAVE, hexdec("1e006")+demo1
'Input #SAVE, Demo$
Demo$=Demo$+input$(#SAVE, 1)
demolength=demolength+1
if input$(#SAVE, 2)=endSAV$ then
demolength=demolength+2
exit for
end if
next
end if
if DemoSlot=2 then
for demo1=0 to 1985
SEEK #SAVE, hexdec("1e800")+demo1
Demo$=Demo$+input$(#SAVE, 1)
demolength=demolength+1
if input$(#SAVE, 2)=endSAV$ then
demolength=demolength+2
exit for
end if
next
end if
end if
if FileSlot=4 then
if DemoSlot=1 then
for demo1=0 to 1985
SEEK #SAVE, hexdec("1f006")+demo1
'Input #SAVE, Demo$
Demo$=Demo$+input$(#SAVE, 1)
demolength=demolength+1
if input$(#SAVE, 2)=endSAV$ then
demolength=demolength+2
exit for
end if
next
end if
if DemoSlot=2 then
for demo1=0 to 1985
SEEK #SAVE, hexdec("1f800")+demo1
Demo$=Demo$+input$(#SAVE, 1)
demolength=demolength+1
if input$(#SAVE, 2)=endSAV$ then
demolength=demolength+2
exit for
end if
next
end if
end if
close #SAVE
print "SAV CLOSED"
print #card, Demo$
print #card, chr$(255)+chr$(255)
fill=hexdec("b8")-4
headerdemo=90
fill2=0
while fill2<loc(#card)
fill2=fill2+1
fill=fill+1
if fill >= 256 then fill=0
wend
while loc(#card) < 2076
print #card, chr$(fill)
fill=fill+1
if fill = 256 then fill=0
wend
close #card
notice "Creating Demo Card is a success !"
wait
'Multi Item Window !
'-----------------------------------------------------
'*---------------------------------------------------*
[MultiItemWin]
WindowWidth = 300
WindowHeight = 340
BUTTON #multi.quit, " Quit ", [QuitMulti], LR, 52, 5
BUTTON #multi.makecrd, "Make the card !", [makemulticrd], LL, 82, 0-11
STATICTEXT #multi, "Card Identifier (0-255) :", 75, 8, 107, 15
TEXTBOX #multi.crdID, 185, 5, 30, 20
GROUPBOX #multi.options, "Multi Item Options", 5, 32, 175, 40
STATICTEXT #multi, "Number of Items (15 MAX) :", 10, 50, 133, 15
TEXTBOX #multi.number, 75+10+9+50, 47, 30, 20
GROUPBOX #multi.regiongrp, "Region:", 188+38, 150-150, 62, 50
RADIOBUTTON #multi.regUS, "US", [USm], [wait], 192+38, 165-150, 30, 15
RADIOBUTTON #multi.regJA, "Japan+", [Japm], [wait], 192+38, 180-150, 52, 15
GROUPBOX #multi.items, "Items", 5, 78, 270+13, 150+37
STATICTEXT #multi, "1", 10, 99, 6, 15
COMBOBOX #multi.item1, pwrup$(), [pwrup], 5+10+5-1, 95, 125, 15
STATICTEXT #multi, "2", 10+125+12, 99, 6, 15
COMBOBOX #multi.item2, pwrup$(), [pwrup], 5+10+5+125+12, 95, 125, 15
STATICTEXT #multi, "3", 10, 99+20, 6, 15
COMBOBOX #multi.item3, pwrup$(), [pwrup], 5+10+5-1, 95+20, 125, 15
STATICTEXT #multi, "4", 10+125+12, 99+20, 6, 15
COMBOBOX #multi.item4, pwrup$(), [pwrup], 5+10+5+125+12, 95+20, 125, 15
STATICTEXT #multi, "5", 10, 99+20+20, 6, 15
COMBOBOX #multi.item5, pwrup$(), [pwrup], 5+10+5-1, 95+20+20, 125, 15
STATICTEXT #multi, "6", 10+125+12, 99+20+20, 6, 15
COMBOBOX #multi.item6, pwrup$(), [pwrup], 5+10+5+125+12, 95+20+20, 125, 15
STATICTEXT #multi, "7", 10, 99+20+20+20, 6, 15
COMBOBOX #multi.item7, pwrup$(), [pwrup], 5+10+5-1, 95+20+20+20, 125, 15
STATICTEXT #multi, "8", 10+125+12, 99+20+20+20, 6, 15
COMBOBOX #multi.item8, pwrup$(), [pwrup], 5+10+5+125+12, 95+20+20+20, 125, 15
STATICTEXT #multi, "9", 10, 99+20+20+20+20, 6, 15
COMBOBOX #multi.item9, pwrup$(), [pwrup], 5+10+5-1, 95+20+20+20+20, 125, 15
STATICTEXT #multi, "10", 10+125+12-3, 99+20+20+20+20, 12, 15
COMBOBOX #multi.item10, pwrup$(), [pwrup], 5+10+5+125+12, 95+20+20+20+20, 125, 15
STATICTEXT #multi, "11", 10-3, 99+20+20+20+20+20, 12, 15
COMBOBOX #multi.item11, pwrup$(), [pwrup], 5+10+5-1, 95+20+20+20+20+20, 125, 15
STATICTEXT #multi, "12", 10+125+12-3, 99+20+20+20+20+20, 12, 15
COMBOBOX #multi.item12, pwrup$(), [pwrup], 5+10+5+125+12, 95+20+20+20+20+20, 125, 15
STATICTEXT #multi, "13", 10-3, 99+20+20+20+20+20+20, 12, 15
COMBOBOX #multi.item13, pwrup$(), [pwrup], 5+10+5-1, 95+20+20+20+20+20+20, 125, 15
STATICTEXT #multi, "14", 10+125+12-3, 99+20+20+20+20+20+20, 12, 15
COMBOBOX #multi.item14, pwrup$(), [pwrup], 5+10+5+125+12, 95+20+20+20+20+20+20, 125, 15
STATICTEXT #multi, "15", 10-3, 99+20+20+20+20+20+20+20, 12, 15
COMBOBOX #multi.item15, pwrup$(), [pwrup], 5+10+5-1, 95+20+20+20+20+20+20+20, 125, 15
open "Multi-Item (Power-Up Card)" for window_nf as #multi
print #multi, "trapclose [QuitMulti]"
print #multi.crdID, "0"
print #multi.number, "1"
print #multi.item1, "selectindex 1"
print #multi.item2, "selectindex 1"
print #multi.item3, "selectindex 1"
print #multi.item4, "selectindex 1"
print #multi.item5, "selectindex 1"
print #multi.item6, "selectindex 1"
print #multi.item7, "selectindex 1"
print #multi.item8, "selectindex 1"
print #multi.item9, "selectindex 1"
print #multi.item10, "selectindex 1"
print #multi.item11, "selectindex 1"
print #multi.item12, "selectindex 1"
print #multi.item13, "selectindex 1"
print #multi.item14, "selectindex 1"
print #multi.item15, "selectindex 1"
print #multi.regUS, "set"
regionm=0
wait
[QuitMulti]
close #multi
wait
[USm]
regionm=0
wait
[Japm]
regionm=1
wait
[makemulticrd]
filedialog "Save SMA4 Card...", "*.bin", fileName$
if fileName$ <> "" then
print "Création du fichier (multi)..."
print #multi.crdID, "!contents? crdID$";
print #multi.number, "!contents? numberitems";
if crdID$="" then crdID$="0"
if numberitems=0 then
notice "Hey ! No items on a Power-Up Card ?!"
wait
end if
if numberitems>=16 then
notice "Too much items !"
wait
end if
DIM makpwrmulti$(numberitems)
if numberitems>0 then
if numberitems>=1 then
print #multi.item1, "selectionindex? makpwr1$"
makpwrmulti$(1)=makpwr1$
if numberitems>=2 then
print #multi.item2, "selectionindex? makpwr2$"
makpwrmulti$(2)=makpwr2$
if numberitems>=3 then
print #multi.item3, "selectionindex? makpwr3$"
makpwrmulti$(3)=makpwr3$
if numberitems>=4 then
print #multi.item4, "selectionindex? makpwr4$"
makpwrmulti$(4)=makpwr4$
if numberitems>=5 then
print #multi.item5, "selectionindex? makpwr5$"
makpwrmulti$(5)=makpwr5$
if numberitems>=6 then
print #multi.item6, "selectionindex? makpwr6$"
makpwrmulti$(6)=makpwr6$
if numberitems>=7 then
print #multi.item7, "selectionindex? makpwr7$"
makpwrmulti$(7)=makpwr7$
if numberitems>=8 then
print #multi.item8, "selectionindex? makpwr8$"
makpwrmulti$(8)=makpwr8$
if numberitems>=9 then
print #multi.item9, "selectionindex? makpwr9$"
makpwrmulti$(9)=makpwr9$
if numberitems>=10 then
print #multi.item10, "selectionindex? makpwr10$"
makpwrmulti$(10)=makpwr10$
if numberitems>=11 then
print #multi.item11, "selectionindex? makpwr11$"
makpwrmulti$(11)=makpwr11$
if numberitems>=12 then
print #multi.item12, "selectionindex? makpwr12$"
makpwrmulti$(12)=makpwr12$
if numberitems>=13 then
print #multi.item13, "selectionindex? makpwr13$"
makpwrmulti$(13)=makpwr13$
if numberitems>=14 then
print #multi.item14, "selectionindex? makpwr14$"
makpwrmulti$(14)=makpwr14$
if numberitems=15 then
print #multi.item15, "selectionindex? makpwr15$"
makpwrmulti$(15)=makpwr15$
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
end if
gosub [MAKEITEMSCARD]
end if
wait
[MAKEITEMSCARD]
open fileName$ for binary as #card
print "Fichier Crée"
print #card, chr$(hexdec("71")+regionm)+chr$(hexdec("F0"))+chr$(hexdec("10"))+chr$(hexdec("18"))+chr$(hexdec("22"))+chr$(hexdec("1a"))+chr$(0)+chr$(hexdec("02"))+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(val(crdID$))+chr$(6)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(numberitems)+chr$(0)+chr$(DenyE)
print "Insertion du header."
carditems=1
'for carditems = 1 to numberitems
while numberitems+1 > carditems
'makpwrmul2=val(makpwrmulti$(carditems))
print #card, chr$(val(makpwrmulti$(carditems)))
carditems=carditems+1
print makpwrmul2
wend
'next
fill=hexdec("0e")+numberitems
while loc(#card) < 2076
print #card, chr$(fill)
fill=fill+1
if fill = 256 then fill=0
wend
close #card
print "Terminé."
notice "Creating Power-up Card (Multi-Item) is a success."
wait
[makemultieff]
if NumEffects = 0 then
notice "A switch with no effects at all isn't useful."
wait
end if
if NumEffects >=11 then
notice "That's not normal at all."
wait
end if
notice "Don't be surprised if it doesn't work at all."
filedialog "Save SMA4 Card...", "*.bin", fileName$
if fileName$ <> "" then
print "Création du fichier (multi)..."
print #multi.crdID, "!contents? crdID$";
print #multi.swicolor, "selectionindex? makpwr$"
gosub [MAKEMULTISWITCH]
end if
[MAKEMULTISWITCH]
open fileName$ for binary as #card
print "Fichier Crée"
print #card, chr$(hexdec("71")+regionm)+chr$(hexdec("F0"))+chr$(hexdec("10"))+chr$(hexdec("18"))+chr$(hexdec("22"))+chr$(hexdec("1a"))+chr$(0)+chr$(hexdec("02"))+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+"Super Mario Advance 4"+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(val(crdID$))+chr$(6)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(0)+chr$(val(makpwr$)+1)+chr$(NumEffects)+chr$(0)+chr$(DenyE)
print "Insertion du header."
if Effect0=1 then print #card, chr$(0)
if Effect1=1 then print #card, chr$(1)
if Effect2=1 then print #card, chr$(2)
if Effect3=1 then print #card, chr$(3)
if Effect4=1 then print #card, chr$(4)
if Effect5=1 then print #card, chr$(5)
if Effect6=1 then print #card, chr$(6)
if Effect7=1 then print #card, chr$(7)
if Effect9=1 then print #card, chr$(9)
if Effect15=1 then print #card, chr$(15)
fill=hexdec("0f")+NumEffects-1
while loc(#card) < 2076
print #card, chr$(fill)
fill=fill+1
if fill = 256 then fill=0
wend
close #card
print "Terminé."
notice "Creating Switch Card (Multi Effects) is a success."
wait
'NumEffects=0
'Effect0=0
'Effect1=0
'Effect2=0
'Effect3=0
'Effect4=0
'Effect5=0
'Effect6=0
'Effect7=0
'Effect9=0
'Effect15=0
'GUI
WindowWidth = 300
WindowHeight = 300
BUTTON #maker.quit, " Quit ", [quit], LR, 52, 5
BUTTON #maker.makecrd, "Make the card !", [makecrd], LL, 82, 0-11
STATICTEXT #maker, "Card Identifier (0-255) :", 75, 8, 107, 15
TEXTBOX #maker.crdID, 185, 5, 30, 20
'Power-up Card Group
GROUPBOX #maker.pwrupgrp, "Power-up Card", 5, 32, 270+13, 72-10
RADIOBUTTON #maker.item, "Item :", [pwrupitemradio], [wait], 5+10, 45+5, 44, 15
'STATICTEXT #maker, "Item :", 5+10, 45+5, 30, 15
COMBOBOX #maker.pwrup, pwrup$(), [pwrup], 5+10+30+15, 60-13, 125, 15
RADIOBUTTON #maker.1up, "1-ups (1-255) :", [pwrup1upradio], [wait], 5+10, 45+5+22, 44+15+25, 15
'STATICTEXT #maker, "1-ups (1-999) :", 5+10, 85-12, 70, 15
TEXTBOX #maker.oneUP, 75+10+17, 82-12, 30, 20
BUTTON #maker.manyitem, "Multi Item Card", [MultiItemWin], UR, -23, 50, 80, 30
'Switch Card Group
GROUPBOX #maker.switchgrp, "Switch Card", 5, 100, 270+13, 72-25+15
STATICTEXT #maker, "Switch Color :", 10, 130-10-1-2, 70, 15
COMBOBOX #maker.swicolor, swicolor$(), [wait], 80, 130-10-5-2, 80, 15
STATICTEXT #maker, "Effect :", 10, 130-10-1+19, 35, 15
COMBOBOX #maker.swieffect, swieffects$(), [wait], 80-35, 130-10-5-2+20, 240, 15
'Card-Making Group
GROUPBOX #maker.crdmakgrp, "Which card to make:", 5, 150+15, 120, 65
RADIOBUTTON #maker.makpwrup, "Power-up Card", [ChooseMAKPWR], [wait], 10, 165+15, 90, 15
RADIOBUTTON #maker.makswitch, "Switch Card", [ChooseMAKSWI], [wait], 10, 180+15, 90, 15
RADIOBUTTON #maker.makdemo, "Demo Card", [wait], [wait], 10, 195+15, 90, 15
'Region Group
GROUPBOX #maker.regiongrp, "Region:", 188+38, 150+15, 62, 50
RADIOBUTTON #maker.regUS, "US", [US], [wait], 192+38, 165+15, 30, 15
RADIOBUTTON #maker.regJA, "Japan+", [Jap], [wait], 192+38, 180+15, 52, 15
'Other Options Group
GROUPBOX #maker.other, "Other:", 130, 150+15, 62+30, 40
CHECKBOX #maker.eWorldDeny, "Deny World-e", [eWorldDenyYES], [eWorldDenyNO], 135, 180, 85, 15
open "SMA4 eCard Maker v0.03" for window_nf as #maker
print #maker, "trapclose [quit]"
'Default Options
print #maker.pwrup, "selectindex 1"
print #maker.item, "set"
print #maker.oneUP, "1"
print #maker.oneUP, "!disable"
print #maker.makpwrup, "set"
print #maker.makdemo, "disable"
print #maker.regUS, "set"
print #maker.crdID, "0"
pwrupchoose=0
region=0
CARDMAKE=0
DenyE=0
print #maker.swicolor, "selectindex 1"
print #maker.swieffect, "selectindex 1"
print #maker.swicolor, "disable"
print #maker.swieffect, "disable"
'debug
print "Program Started."
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment