{"id":521,"date":"2014-01-27T20:22:07","date_gmt":"2014-01-28T01:22:07","guid":{"rendered":"http:\/\/snarfblam.com\/words\/?p=521"},"modified":"2018-03-22T18:30:26","modified_gmt":"2018-03-22T23:30:26","slug":"automap-without-the-map","status":"publish","type":"post","link":"http:\/\/snarfblam.com\/words\/?p=521","title":{"rendered":"Automap Without The Map"},"content":{"rendered":"<p>I&#8217;ve been asked if there was a version of the <em>Automap Plus<\/em> patch without the automap. In other words, just the partial heart pieces in the HUD and faster life refilling with potions and fairies. Easy enough: just chop all of the map-related stuffs from the code, and voila.<\/p>\n<p>Download the IPS patch with source included (<a href=\"http:\/\/snarfblam.com\/files\/Automap NoMap.zip\">Automap NoMap.zip<\/a>), or, for your convenience, the code is available below.<!--more--><\/p>\n<pre>; Zelda auto-map Patch \r\n; 0.2\r\n; NO MAP EDITION\r\n;\r\n; By snarfblam\r\n; ----------------------------\r\n; Includes:\r\n;   -1\/8 heart increments\r\n;   -Faster potion\/fairy refill\r\n;   -Changed magic key count from \"A\" to \"infinity\" symbol\r\n\r\n; Note that most of these are unused in the no-map version\r\n;========================================================\r\n; Variable declarations\r\n;========================================================\r\n\r\n; Game variables\r\n; --------------\r\nLevelNumber         := $10\r\nSaveSlot            := $16\r\nPendingPpuMacro     := $14\r\nCurrentMapLocation  := $EB\r\nNewMapLocation      := $EC\r\nOAM_MapBlipY        := $0254\r\n\r\n; Game routines\r\n; -------------\r\nBankSwap        := $FFAC\r\nSendPpuMacro    := $A0F6\r\n\r\n; Our addresses\r\n;----------------------\r\nMapTiles    = $AD00 ; 06:AD00\r\nVRAM_MapTiles = $1300\r\n\r\n; Our variables\r\n; -----------------\r\n.enum $6C00\r\n    tileFlag:   .dsb 1  ; Used to indicate that there is a pending PPU macro for the map\r\n    mapVar:     .dsb 1  ; Temporary storage variable\r\n    mapVar_X:   .dsb 1  \r\n    mapVar_Y:   .dsb 1\r\n    mapLoop_X:  .dsb 1\r\n    mapLoop_Y:  .dsb 1\r\n.endenum\r\n.enum $7F10\r\n    SecondPpuStringIndex: .DSB 1    ;\r\n\r\n    MapBits_Left:   .DSB 1      ; Stores flags for whether the two screens in the left\/right side\r\n    MapBits_Right:  .DSB 1      ; of the current map tile have been visited, in lower 2 bits\r\n\r\n    MapFilter_Top:    .DSB 1    ; Stores a value to be ANDed with the bytes of a map tile to black out unvisited screens\r\n    MapFilter_Bottom: .DSB 1\r\n\r\n    MapTileMacro:   .DSB $14    ; 10 bytes of tile data, 2 byte pointer, 1 byte len specifier, 1 byte FF terminator\r\n\r\n;    TempAddress:    .DW 1\r\n\r\n    MapBlipY:       .DSB $1     ; Stores the y-coordinate of the map blip\r\n.ende\r\n.enum $7F50\r\n    MapRam:     .DSB $10\r\n    MapSaveRam: .DSB $30\r\n.ende\r\n\r\n; Registers\r\n; ---------\r\nPpuControl1     := $2000\r\nPpuControl2     := $2001\r\nPpuStatus       := $2002\r\nOamAddress      := $2003\r\nOamData         := $2004\r\nPpuScroll       := $2005\r\nPpuAddress      := $2006\r\nPpuData         := $2007\r\n\r\n; ===========================================================\r\n;  \"AUTOMAP BY SNARF\"\r\n; ===========================================================\r\n; Adds by-line to title screen\r\n\r\n.PATCH $1A8C5\r\n.db $24, $24, $17, $18, $16, $0A, $19, $24, $00, $2C, $02, $24, $0B, $22, $24, $1C, $17, $0A, $1B, $0F\r\n;              N    O    M    A    P         0    .    1         B    Y         S    N    A    R    F \r\n\r\n; ===========================================================\r\n;  New heart data\r\n; ===========================================================\r\n\r\n; New heart PPU macros\r\n; --------------------\r\n; The PPU addresses of these macros have been swapped so that the hearts fill the top row before the bottom row.\r\n\r\n.PATCH $6517\r\n; First row of hearts\r\n.db $20, $D6\r\n.db $08\r\n.db $24, $24, $24, $24, $24, $24, $24, $24\r\n\r\n; Second row of hearts\r\n.db $20, $B6\r\n.db $08\r\n.db $24, $24, $24, $24, $24, $24, $24, $24\r\n\r\n; \"-LIFE-\" (unchanged)\r\n.PATCH $1bF1E\r\n.db $62, $15, $12, $0F, $0E, $62\r\n\r\n; New heart tiles\r\n; ---------------\r\n.PATCH $8C8F\r\n.HEX 6c ee ee ee fe 7c 38 10 6c 9e de fe fe 7c 38 10 ; Partial hearts\r\n.HEX 6c ee ee ee fe 7c 38 10 6c 9e 9e 9e fe 7c 38 10 \r\n.HEX 6c ee ee ee ee 5c 38 10 6c 9e 9e 9e 9e 7c 38 10 \r\n.HEX 6c ee ee ee ee 6c 38 10 6c 9e 9e 9e 9e 5c 28 10 \r\n.HEX 6c fe ee ee f6 7c 38 10 6c 9e 9e 9e 8e 44 28 10 \r\n.HEX 6c fe ee fe fe 7c 38 10 6c 9e 9e 82 82 44 28 10 \r\n.HEX 6c fa e6 fe fe 7c 38 10 6c 9e 9a 82 82 44 28 10 \r\n.HEX 6c fa e6 fe fe 7c 38 10 6c 9e 9a 82 82 44 28 10 \r\n.HEX 6c 9e 9a b2 f2 6c 00 00 00 00 00 00 00 00 00 00 \r\n\r\n.PATCH $8E8F\r\n.HEX 6c fe fe fe fe 7c 38 10 6c 92 82 82 82 44 28 10 ; Whole heart\r\n\r\n; Magic key tile index\r\n; --------------------\r\n; This byte specifies the tile index to use for the key count when player has the magic key\r\n.PATCH $65b2\r\n.db $58\r\n\r\n; ===========================================================\r\n;  Partial heart routine\r\n; ===========================================================  \r\n\r\n; Partial heart routine\r\n; ---------------------\r\n.PATCH 05:BC30\r\n\r\nPartialHeartRoutine:\r\n;   Returns appropriate tile index in A\r\n\r\n    LDA $0F     ; Load partial-heart value\r\n    LSR         ; Divide by $20 (into a range of 0-7)\r\n    LSR\r\n    LSR\r\n    LSR\r\n    LSR\r\n\r\n    CLC\r\n    ADC #$50    ; Partial-heart tiles are # 50-57\r\n\r\n    JMP $6ED7   ; Return from hijack\r\n\r\n; Hijack\r\n; ------\r\n\r\n; Original code\r\n; (1):6EC8:C9 80     CMP #$80          ; If partial-heart-value &gt;= #$80, load full-heart-tile\r\n;    :6ECA:B0 F4     BCS $6EC0         \r\n;    :6ECC:A9 00     LDA #$00          ; ??????????????\r\n;    :6ECE:8D 29 05  STA $0529    \r\n; (2):6ED1:A9 65     LDA #$65          ; Load half-full heart tile\r\n;    :6ED3:D0 02     BNE $6ED7         ; Branch always   \r\n;\r\n; (1) - Update value of CMP #$80 to run our partial heart routine for smaller increments\r\n; (2) - Hijack goes here\r\n\r\n.PATCH $6748\r\n.BASE  $6EC8    ; This code is run from RAM\r\n\r\n    CMP #$E0\r\n    BCS $6EC0\r\n\r\n*   LDA #$00\r\n    STA $0529\r\n\r\n    JMP PartialHeartRoutine\r\n\r\n; ===========================================================\r\n;  Fast life fill\r\n; ===========================================================\r\n; Causes life to fill faster with potion\/fairy\r\n\r\n; ORIGINAL CODE\r\n;   05:B1EF   LDA $0670             ; If current heart &gt; #$F8 (out of #$100):\r\n;   05:B1F2   CMP #$F8              ; \r\n;   05:B1F4   BCS $B1FD             ;   Jump to routine to set current heart to 0 and increment full-heart count\r\n;\r\n;   05:B1F6   CLC                   ; Add #$06 to current heart value (out of #$100), and return\r\n;   05:B1F7   ADC #$06              ;\r\n;   05:B1F9   STA $0670             ;\r\n;   05:B1FC   RTS                   ;\r\n\r\n;.ORG $B1EF\r\n;.PATCH $171FF\r\n.PATCH 05:B1EF\r\n    LDA $0670\r\n    CMP #$D7              ; \r\n    BCS $B1FD             ;   Jump to routine to set current heart to 0 and increment full-heart count\r\n\r\n    CLC                   ; Add #$06 to current heart value (out of #$100), and return\r\n    ADC #$18              ;\r\n    STA $0670             ;\r\n    RTS                   ;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been asked if there was a version of the Automap Plus patch without the automap. In other words, just the partial heart pieces in the HUD and faster life refilling with potions and fairies. Easy enough: just chop all of the map-related stuffs from the code, and voila. Download the IPS patch with source [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31,4,3],"tags":[26,27,10,28,33],"class_list":["post-521","post","type-post","status-publish","format-standard","hentry","category-asm-romhacking","category-general","category-romhacking","tag-26","tag-asm","tag-hacking","tag-snarfblasm","tag-zelda"],"_links":{"self":[{"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/posts\/521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=521"}],"version-history":[{"count":6,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/posts\/521\/revisions"}],"predecessor-version":[{"id":540,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=\/wp\/v2\/posts\/521\/revisions\/540"}],"wp:attachment":[{"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=521"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/snarfblam.com\/words\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}