diff --git a/.gitignore b/.gitignore index 655af00..1f8c252 100644 --- a/.gitignore +++ b/.gitignore @@ -46,9 +46,13 @@ Temporary Items *.3dsx *.elf *.smdh +*.cia build # Eclipse .settings .cproject .project + +# Copyrighted Executables +*.exe diff --git a/Makefile b/Makefile index 1d7cf8c..ea1b739 100644 --- a/Makefile +++ b/Makefile @@ -26,15 +26,15 @@ include $(DEVKITARM)/3ds_rules # - icon.png # - /default_icon.png #--------------------------------------------------------------------------------- -TARGET := Minicraft3DS +TARGET := result/Minicraft3DS BUILD := build SOURCES := source source/minizip DATA := data INCLUDES := include APP_TITLE := Minicraft 3DS -APP_DESCRIPTION := Minicraft was originally created by Markus "Notch" Perrson. This was ported to the 3DS by Davideesk. -APP_AUTHOR := Davideesk and andre111 +APP_DESCRIPTION := Minicraft was originally created by Markus "Notch" Perrson. Ported to the 3DS by Davideesk. +APP_AUTHOR := Davideesk/andre111/ElijahZAwesome #--------------------------------------------------------------------------------- # options for code generation @@ -109,8 +109,8 @@ ifeq ($(strip $(ICON)),) ifneq (,$(findstring $(TARGET).png,$(icons))) export APP_ICON := $(TOPDIR)/$(TARGET).png else - ifneq (,$(findstring icon.png,$(icons))) - export APP_ICON := $(TOPDIR)/icon.png + ifneq (,$(findstring icons-banners/icon.png,$(icons))) + export APP_ICON := $(TOPDIR)/icons-banners/icon.png endif endif else @@ -139,12 +139,12 @@ $(TARGET)-strip.elf: $(BUILD) @$(STRIP) $(TARGET).elf -o $(TARGET)-strip.elf #--------------------------------------------------------------------------------- cci: $(TARGET)-strip.elf - @makerom -f cci -rsf resources/$(TARGET).rsf -target d -exefslogo -elf $(TARGET)-strip.elf -o $(TARGET).3ds - @echo "built ... sfil_sample.3ds" + @makerom -f cci -rsf resources/$(TARGET).rsf -target d -exefslogo -elf $(TARGET)-strip.elf -o $(TARGET).3ds -desc App:0x1B + @echo "built ... Minicraft3DS.3ds" #--------------------------------------------------------------------------------- cia: $(TARGET)-strip.elf @makerom -f cia -o $(TARGET).cia -elf $(TARGET)-strip.elf -rsf resources/$(TARGET).rsf -exefslogo -target t - @echo "built ... sfil_sample.cia" + @echo "built ... Minicraft3DS.cia" #--------------------------------------------------------------------------------- send: $(BUILD) @3dslink $(TARGET).3dsx diff --git a/Minicraft3DS.zip b/Minicraft3DS.zip deleted file mode 100644 index a3d6012..0000000 Binary files a/Minicraft3DS.zip and /dev/null differ diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..33f0c28 --- /dev/null +++ b/build.bat @@ -0,0 +1,6 @@ +make +bannertool.exe makebanner -i icons-banners/banner.png -a icons-banners/audio.wav -o icons-banners/banner.bnr +bannertool.exe makesmdh -s "Minicraft3DS" -l "3DS Homebrew port of Notch's ludum dare game 'Minicraft', updated." -p "Davideesk/Andre111/ElijahZAwesome" -i icons-banners/icon.png -o icons-banners/icon.icn +makerom -f cia -o result/Minicraft3DS.cia -DAPP_ENCRYPTED=false -rsf icons-banners/Minicraft3DS.rsf -target t -exefslogo -elf result/Minicraft3DS.elf -icon icons-banners/icon.icn -banner icons-banners/banner.bnr +makerom -f cci -o result/Minicraft3DS.3ds -DAPP_ENCRYPTED=true -rsf icons-banners/Minicraft3DS.rsf -target t -exefslogo -elf result/Minicraft3DS.elf -icon icons-banners/icon.icn -banner icons-banners/banner.bnr +pause \ No newline at end of file diff --git a/data/icons2.png b/data/icons2.png index b9f6d6a..2d8e5a5 100644 Binary files a/data/icons2.png and b/data/icons2.png differ diff --git a/icons-banners/Minicraft3DS.rsf b/icons-banners/Minicraft3DS.rsf new file mode 100644 index 0000000..52914d9 --- /dev/null +++ b/icons-banners/Minicraft3DS.rsf @@ -0,0 +1,195 @@ +BasicInfo: + Title : "Cia Builder Example" + CompanyCode : "00" + ProductCode : "CTR-P-PWDR" + ContentType : Application + Logo : Homebrew # Nintendo / Licensed / Distributed / iQue / iQueForSystem + +TitleInfo: + UniqueId : 0xFAA5C # Cia Builder Example Unique ID, you need to set your own one + Category : Application + +CardInfo: + MediaSize : 128MB # 128MB / 256MB / 512MB / 1GB / 2GB / 4GB + MediaType : Card1 # Card1 / Card2 + CardDevice : None # NorFlash(Pick this if you use savedata) / None + + +Option: + UseOnSD : true # true if App is to be installed to SD + FreeProductCode : true # Removes limitations on ProductCode + MediaFootPadding : false # If true CCI files are created with padding + EnableCrypt : false # Enables encryption for NCCH and CIA + EnableCompress : true # Compresses exefs code + +AccessControlInfo: + #UseExtSaveData : true + #ExtSaveDataId: 0xff3ff + #UseExtendedSaveDataAccessControl: true + #AccessibleSaveDataIds: [0x101, 0x202, 0x303, 0x404, 0x505, 0x606] + +SystemControlInfo: + SaveDataSize: 128KB + RemasterVersion: 0 + StackSize: 0x40000 + +# DO NOT EDIT BELOW HERE OR PROGRAMS WILL NOT LAUNCH (most likely) + +AccessControlInfo: + FileSystemAccess: + - Debug + - DirectSdmc + - DirectSdmcWrite + + IdealProcessor : 0 + AffinityMask : 1 + + Priority : 16 + + MaxCpu : 0x9E # Default + DisableDebug : false + EnableForceDebug : false + CanWriteSharedPage : false + CanUsePrivilegedPriority : false + CanUseNonAlphabetAndNumber : false + PermitMainFunctionArgument : false + CanShareDeviceMemory : false + RunnableOnSleep : false + SpecialMemoryArrange : false + CoreVersion : 2 + DescVersion : 2 + + ReleaseKernelMajor : "02" + ReleaseKernelMinor : "33" + MemoryType : Application + HandleTableSize: 512 + + SystemModeExt : Legacy # Legacy(Default)/124MB/178MB Legacy:Use Old3DS SystemMode + CpuSpeed : 804MHz # 268MHz(Default)/804MHz + EnableL2Cache : true # false(default)/true + CanAccessCore2 : true + + IORegisterMapping: + - 1ff50000-1ff57fff + - 1ff70000-1ff77fff + MemoryMapping: + - 1f000000-1f5fffff:r + SystemCallAccess: + ArbitrateAddress: 34 + Break: 60 + CancelTimer: 28 + ClearEvent: 25 + ClearTimer: 29 + CloseHandle: 35 + ConnectToPort: 45 + ControlMemory: 1 + CreateAddressArbiter: 33 + CreateEvent: 23 + CreateMemoryBlock: 30 + CreateMutex: 19 + CreateSemaphore: 21 + CreateThread: 8 + CreateTimer: 26 + DuplicateHandle: 39 + ExitProcess: 3 + ExitThread: 9 + GetCurrentProcessorNumber: 17 + GetHandleInfo: 41 + GetProcessId: 53 + GetProcessIdOfThread: 54 + GetProcessIdealProcessor: 6 + GetProcessInfo: 43 + GetResourceLimit: 56 + GetResourceLimitCurrentValues: 58 + GetResourceLimitLimitValues: 57 + GetSystemInfo: 42 + GetSystemTick: 40 + GetThreadContext: 59 + GetThreadId: 55 + GetThreadIdealProcessor: 15 + GetThreadInfo: 44 + GetThreadPriority: 11 + MapMemoryBlock: 31 + OutputDebugString: 61 + QueryMemory: 2 + ReleaseMutex: 20 + ReleaseSemaphore: 22 + SendSyncRequest1: 46 + SendSyncRequest2: 47 + SendSyncRequest3: 48 + SendSyncRequest4: 49 + SendSyncRequest: 50 + SetThreadPriority: 12 + SetTimer: 27 + SignalEvent: 24 + SleepThread: 10 + UnmapMemoryBlock: 32 + WaitSynchronization1: 36 + WaitSynchronizationN: 37 + InterruptNumbers: + ServiceAccessControl: + - APT:U + - $hioFIO + - $hostio0 + - $hostio1 + - ac:u + - boss:U + - cam:u + - ir:rst + - cfg:u + - dlp:FKCL + - dlp:SRVR + - dsp::DSP + - frd:u + - fs:USER + - gsp::Gpu + - hid:USER + - http:C + - mic:u + - ndm:u + - news:s + - nwm::UDS + - ptm:u + - pxi:dev + - soc:U + - gsp::Lcd + - y2r:u + - ldr:ro + - ir:USER + - ir:u + - csnd:SND + - am:u + - ns:s + +SystemControlInfo: + Dependency: + ac: 0x0004013000002402L + am: 0x0004013000001502L + boss: 0x0004013000003402L + camera: 0x0004013000001602L + cecd: 0x0004013000002602L + cfg: 0x0004013000001702L + codec: 0x0004013000001802L + csnd: 0x0004013000002702L + dlp: 0x0004013000002802L + dsp: 0x0004013000001a02L + friends: 0x0004013000003202L + gpio: 0x0004013000001b02L + gsp: 0x0004013000001c02L + hid: 0x0004013000001d02L + http: 0x0004013000002902L + i2c: 0x0004013000001e02L + ir: 0x0004013000003302L + mcu: 0x0004013000001f02L + mic: 0x0004013000002002L + ndm: 0x0004013000002b02L + news: 0x0004013000003502L + nim: 0x0004013000002c02L + nwm: 0x0004013000002d02L + pdn: 0x0004013000002102L + ps: 0x0004013000003102L + ptm: 0x0004013000002202L + ro: 0x0004013000003702L + socket: 0x0004013000002e02L + spi: 0x0004013000002302L + ssl: 0x0004013000002f02L \ No newline at end of file diff --git a/icons-banners/audio.wav b/icons-banners/audio.wav new file mode 100644 index 0000000..b28a2e6 Binary files /dev/null and b/icons-banners/audio.wav differ diff --git a/icons-banners/banner.bnr b/icons-banners/banner.bnr new file mode 100644 index 0000000..8b1cf01 Binary files /dev/null and b/icons-banners/banner.bnr differ diff --git a/icons-banners/banner.png b/icons-banners/banner.png new file mode 100644 index 0000000..45b47c1 Binary files /dev/null and b/icons-banners/banner.png differ diff --git a/icons-banners/icon.icn b/icons-banners/icon.icn new file mode 100644 index 0000000..676c355 Binary files /dev/null and b/icons-banners/icon.icn differ diff --git a/icon.png b/icons-banners/icon.png similarity index 100% rename from icon.png rename to icons-banners/icon.png diff --git a/result/Minicraft3DS.3ds b/result/Minicraft3DS.3ds new file mode 100644 index 0000000..30cccfd Binary files /dev/null and b/result/Minicraft3DS.3ds differ diff --git a/source/Crafting.c b/source/Crafting.c index 70eeedf..a043e45 100644 --- a/source/Crafting.c +++ b/source/Crafting.c @@ -140,7 +140,7 @@ void initRecipes(){ loomRecipes.recipes = (Recipe*)malloc(sizeof(Recipe) * (loomRecipes.size)); loomRecipes.recipes[0] = defineRecipe(ITEM_STRING,1,1,ITEM_WOOL,1); - enchanterRecipes.size = 7; + enchanterRecipes.size = 8; enchanterRecipes.recipes = (Recipe*)malloc(sizeof(Recipe) * (enchanterRecipes.size)); enchanterRecipes.recipes[0] = defineRecipe(TOOL_SWORD,4,2,ITEM_WOOD,5,ITEM_GEM,50); enchanterRecipes.recipes[1] = defineRecipe(TOOL_AXE,4,2,ITEM_WOOD,5,ITEM_GEM,50); @@ -149,6 +149,7 @@ void initRecipes(){ enchanterRecipes.recipes[4] = defineRecipe(TOOL_SHOVEL,4,2,ITEM_WOOD,5,ITEM_GEM,50); enchanterRecipes.recipes[5] = defineRecipe(ITEM_ARROW_GEM,1,3,ITEM_WOOD,1,ITEM_GEM,3,ITEM_STRING,1); enchanterRecipes.recipes[6] = defineRecipe(ITEM_WALL_GEM,1,1,ITEM_GEM,10); + enchanterRecipes.recipes[7] = defineRecipe(ITEM_GOLD_APPLE,1,2,ITEM_APPLE,1,ITEM_GOLDINGOT,15); } diff --git a/source/Globals.c b/source/Globals.c index a60546d..c2a243f 100644 --- a/source/Globals.c +++ b/source/Globals.c @@ -1,4 +1,5 @@ #include "Globals.h" +#include "Menu.h" char versionText[34] = "Version 1.3.0"; char fpsstr[34]; @@ -217,7 +218,7 @@ void tickTouchQuickSelect() { } void hurtEntity(Entity* e, int damage, int dir, u32 hurtColor){ - if (TESTGODMODE && e->type==ENTITY_PLAYER) return; + if (shouldRenderDebug && e->type==ENTITY_PLAYER) return; if (e->hurtTime > 0) return; int xd = player.x - e->x; int yd = player.y - e->y; @@ -700,6 +701,13 @@ s8 itemTileInteract(int tile, Item* item, int x, int y, int px, int py, int dir) healPlayer(1); --item->countLevel; } + return 0; + case ITEM_GOLD_APPLE: + if(player.p.health < 10 && playerUseEnergy(1)){ + healPlayer(8); + playerUseEnergy(-10); + --item->countLevel; + } return 0; case ITEM_FLESH: if(player.p.health < 10 && playerUseEnergy(4+(rand()%4))){ @@ -1650,28 +1658,28 @@ void initPlayer(){ player.p.hasWon = false; addItemToInventory(newItem(ITEM_WORKBENCH,0), player.p.inv); - addItemToInventory(newItem(ITEM_POWGLOVE,0), player.p.inv); - - /* + addItemToInventory(newItem(ITEM_POWGLOVE,0), player.p.inv); + if (shouldRenderDebug == true) { addItemToInventory(newItem(TOOL_SHOVEL,4), player.p.inv); addItemToInventory(newItem(TOOL_HOE,4), player.p.inv); addItemToInventory(newItem(TOOL_SWORD,4), player.p.inv); addItemToInventory(newItem(TOOL_PICKAXE,4), player.p.inv); addItemToInventory(newItem(TOOL_AXE,4), player.p.inv); + + addItemToInventory(newItem(ITEM_GOLDINGOT, 60), player.p.inv); + addItemToInventory(newItem(ITEM_APPLE, 1), player.p.inv); addItemToInventory(newItem(ITEM_ANVIL,0), player.p.inv); addItemToInventory(newItem(ITEM_CHEST,0), player.p.inv); addItemToInventory(newItem(ITEM_OVEN,0), player.p.inv); addItemToInventory(newItem(ITEM_FURNACE,0), player.p.inv); addItemToInventory(newItem(ITEM_LANTERN,0), player.p.inv); - - int i; - for (i = 7;i < 28;++i) addItemToInventory(newItem(i,50), player.p.inv); - //*/ + addItemToInventory(newItem(ITEM_ENCHANTER,0), player.p.inv); + } } void playerHurtTile(int tile, int xt, int yt, int damage, int dir){ - if(TESTGODMODE) damage = 99; + if(shouldRenderDebug) damage = 99; char hurtText[11]; switch(tile){ @@ -1868,7 +1876,7 @@ void playerHurtTile(int tile, int xt, int yt, int damage, int dir){ } bool playerUseEnergy(int amount){ - if(TESTGODMODE) return true; + if(shouldRenderDebug) return true; if(amount > player.p.stamina) return false; player.p.stamina -= amount; return true; @@ -2163,7 +2171,7 @@ void tickPlayer(){ if (swimming && player.p.swimTimer % 60 == 0) { if (player.p.stamina > 0) { - if(!TESTGODMODE) --player.p.stamina; + if(!shouldRenderDebug) --player.p.stamina; } else { hurtEntity(&player,1,-1,0xFFAF00FF); } @@ -2176,7 +2184,7 @@ void tickPlayer(){ if(k_attack.clicked){ if (player.p.stamina != 0) { - if(!TESTGODMODE) player.p.stamina--; + if(!shouldRenderDebug) player.p.stamina--; player.p.staminaRecharge = 0; playerAttack(); //addEntityToList(newSlimeEntity(1,200,600,1), &eManager); diff --git a/source/Globals.h b/source/Globals.h index 8c884e9..217dde1 100644 --- a/source/Globals.h +++ b/source/Globals.h @@ -78,8 +78,6 @@ #define SWAP_UINT32(x) (((x) >> 24) | (((x) & 0x00FF0000) >> 8) | (((x) & 0x0000FF00) << 8) | ((x) << 24)) -//TODO: Dont forget to change back -#define TESTGODMODE true bool screenShot; int loadedtp; diff --git a/source/Item.c b/source/Item.c index a1613ba..9190747 100644 --- a/source/Item.c +++ b/source/Item.c @@ -150,6 +150,7 @@ char* getItemName(int itemID, int countLevel){ case ITEM_FLESH: sprintf(currentName,"%d Flesh", countLevel); return currentName; case ITEM_BREAD: sprintf(currentName,"%d Bread", countLevel); return currentName; case ITEM_APPLE: sprintf(currentName,"%d Apple", countLevel); return currentName; + case ITEM_GOLD_APPLE: sprintf(currentName,"%d Golden Apple", countLevel); return currentName; case ITEM_COAL: sprintf(currentName,"%d Coal", countLevel); return currentName; case ITEM_IRONORE: sprintf(currentName,"%d Iron ore", countLevel); return currentName; case ITEM_GOLDORE: sprintf(currentName,"%d Gold ore", countLevel); return currentName; @@ -260,6 +261,7 @@ char* getBasicItemName(int itemID, int countLevel){ case ITEM_FLESH: return "Flesh"; case ITEM_BREAD: return "Bread"; case ITEM_APPLE: return "Apple"; + case ITEM_GOLD_APPLE: return "Gold Apple"; case ITEM_COAL: return "Coal"; case ITEM_IRONORE: return "Iron ore"; case ITEM_GOLDORE: return "Gold ore"; diff --git a/source/Item.h b/source/Item.h index 06b3f37..622ae7b 100644 --- a/source/Item.h +++ b/source/Item.h @@ -75,6 +75,7 @@ #define TOOL_BUCKET 101 #define TOOL_BOW 102 #define TOOL_MAGIC_COMPASS 103 +#define ITEM_GOLD_APPLE 104 typedef struct Inventory Inventory; diff --git a/source/Menu.c b/source/Menu.c index 17ed172..bc94c1e 100644 --- a/source/Menu.c +++ b/source/Menu.c @@ -3,7 +3,7 @@ char options[][12] = {"Start Game", "Join Game", "How To Play","Settings", "About", "Exit"}; char pOptions[][24] = {"Return to game", "Save Progress", "Host World", "Exit to title"}; char keybOptions[][24] = {"Exit and Save", "Exit and Don't save","Reset to default"}; -char setOptions[][24] = {"Rebind Buttons", "Texture packs", "Debug Text: ", "N3DS Speedup: ", "Return to title"}; +char setOptions[][24] = {"Rebind Buttons", "Texture packs", "Test Features: ", "N3DS Speedup: ", "Return to title"}; // Rebind buttons menu (Settings) int keys[] = { @@ -537,7 +537,7 @@ void tickMenu(int menu){ } enterDungeon(); - } else if(TESTGODMODE) { + } else if(shouldRenderDebug) { enterDungeon(); } } else { @@ -1301,7 +1301,8 @@ void renderMenu(int menu,int xscr,int yscr){ drawTextColor("3DS Homebrew Edition",74,120,0xFF00FF00); drawSizedTextColor("This port was made by David Benepe (Davideesk)",16,144,1.0,0xFF00FF00); drawSizedTextColor("just for fun in September/October 2015.",44,156,1.0,0xFF00FF00); - drawSizedTextColor("Updated and modded by Andre Schweiger (andre111)",8,168,1.0,0xFF00FF00); + drawSizedTextColor("Modded by Andre Schweiger (andre111) and ",44,168,1.0,0xFF00FF00); + drawSizedTextColor("Elijah Bansley (ElijahZAwesome)",71,180,1.0,0xFF00FF00); drawSizedTextColor("TY Notch for creating a fun game to remake!",28,192,1.0,0xFF00FF00); sf2d_end_frame(); sf2d_start_frame(GFX_BOTTOM, GFX_LEFT); @@ -1356,7 +1357,7 @@ void renderMenu(int menu,int xscr,int yscr){ drawTextColor("Change the game's art",(320 - (21 * 12))/2,24,0xFF7FFFFF); break; case 2: - drawTextColor("Show FPS/Pos/Entities",(320 - (22 * 12))/2,24,0xFF7FFFFF); + drawTextColor("Enable Testing Features.",(320 - (22 * 12))/2,24,0xFF7FFFFF); break; case 3: drawTextColor("Use the N3DS 804mhz mode",(320 - (24 * 12))/2,24,0xFF7FFFFF); diff --git a/source/Network.h b/source/Network.h index fcbc70d..cc098d7 100644 --- a/source/Network.h +++ b/source/Network.h @@ -3,7 +3,7 @@ #include <3ds.h> #define NETWORK_WLANCOMMID 0x11441850 -#define NETWORK_PASSPHRASE "minicraft3ds localplay passphrase" +#define NETWORK_PASSPHRASE "Minicraft3DS localplay passphrase" #define NETWORK_CHANNEL 1 #define NETWORK_RECVBUFSIZE UDS_DEFAULT_RECVBUFSIZE diff --git a/source/Quests.c b/source/Quests.c index a34eeaf..8a86f85 100644 --- a/source/Quests.c +++ b/source/Quests.c @@ -84,7 +84,16 @@ void openNPCMenu(int npc) { //TODO: Handle upon currentNPC as well as the fitting quest progress switch(currentNPC) { case NPC_GIRL: - + currentTalkOptions = 2; + currentTalkOption0 = "Trade"; + currentTalkOption1 = "What do you do?"; + + currentTalk0 = "Hello!"; + currentTalk1 = "It gets a bit lonely here."; + currentTalk2 = "I hope you stay..."; + currentTalk3 = "But if you don't thats fine."; + currentTalk4 = "sigh"; + currentTalk5 = ""; break; case NPC_PRIEST: currentTalkOptions = 3; @@ -327,7 +336,7 @@ void tickNPCMenu() { questManager.questlines[1].currentQuest = 2; currentTalk0 = "Thank you these will be"; - currentTalk1 = "really helpfull."; + currentTalk1 = "really helpful."; currentTalk2 = "Here take this book with"; currentTalk3 = "it you should be able to"; currentTalk4 = "easily understand anything"; @@ -399,7 +408,7 @@ void renderNPCMenu(int xscr, int yscr) { //TODO: Handle upon currentNPC as well as the fitting quest progress switch(currentNPC) { case NPC_GIRL: - if(currentNPCMenu==NPC_MENU_TALK) renderTalkMenu("TODO"); + if(currentNPCMenu==NPC_MENU_TALK) renderTalkMenu("Girl Jill"); break; case NPC_PRIEST: if(currentNPCMenu==NPC_MENU_TALK) renderTalkMenu("Priest Brom"); diff --git a/source/Render.c b/source/Render.c index b06c6d0..7baf559 100644 --- a/source/Render.c +++ b/source/Render.c @@ -1487,6 +1487,9 @@ void renderItemIcon(int itemID, int countLevel, int x, int y) { case ITEM_APPLE: render(x, y, 80, 152, 0); break; + case ITEM_GOLD_APPLE: + render(x, y, 177, 160, 0); + break; case ITEM_SLIME: renderb(x, y, 88, 152, 0, 0xFF4DC04D); break;