Prev: 48992 Up: Map Next: 49215
49053: New game initialization - set up game data
Used by the routine at 48992.
This section initializes a bunch of new game data - copying bytes/addresses into the 'current game' state.
49053 LD HL,29042 Reset/store the address pointer to the start level text (Gatehouse Level)
49056 LD (60251),HL
49059 LD HL,27772 Address pointer to warlock and creature stat tables
49062 LD (60355),HL
49065 LD HL,27868 Address pointer to missile data tables
49068 LD (60353),HL
49071 LD HL,28156 Reset/store the pointer to the start of spell list text (1st spell = MOVE)
49074 LD (60261),HL
49077 LD HL,28604 Reset/store the pointer to the start of spell name texts -1
49080 LD (60263),HL
49083 LD HL,28605 Reset/store the pointer to the start of spell text messages ('Project thy soul' etc)
49086 LD (60259),HL
49089 LD A,27 27 = total number of spells (for spell list at 28156)
49091 LD (60265),A
49094 LD HL,38851 Reset/store the pointer to the start of an address list pointing at graphics
49097 LD (60266),HL
Code that was used to create the initial game menus and draw the decorative screen border gets overwritten for game data (the player doesn't return to the menu and the border doesn't get erased):
The following instructions initialize a number of address pointers to the new data sets. Each section is terminated with an end-of-data byte (255).
ROOM ITEM/OBJECT/SCENERY DATA SETS FOR THE CURRENT ROOM
49100 LD HL,(56046) Address pointer to room item/object/scenery data sets at 31744
49103 LD DE,768 768 bytes reserved for this
49106 ADD HL,DE
49107 LD (HL),255
FOREGROUND SCENERY DATA SETS FOR CURRENT ROOM
49109 INC HL
49110 LD (60272),HL Address pointer to foreground scenery data sets at 32513
49113 LD DE,112 112 bytes reserved for these
49116 ADD HL,DE
49117 LD (HL),255
MAROC'S INVENTORY - UP TO 4 OBJECTS
49119 INC HL
49120 LD (60346),HL Maroc's inventory ('pockets') - 64 bytes (4 object spaces x 16 bytes) at 32626
49123 LD B,4
49125 LD DE,16
49128 LD (HL),0 Reset first byte of each inventory slots (0 = nothing carried)
49130 ADD HL,DE
49131 DJNZ 49128
49133 LD (HL),255
COLLISION/EVENT CHECKS FOR ELEMENTS IN THE CURRENT ROOM
49135 INC HL
49136 LD (60268),HL Address pointer to elements/objects/events going on in current room at 32691
49139 LD (HL),255 255 = no more events/collisions to check
49141 LD DE,128 128 bytes reserved for these
49144 ADD HL,DE
UNUSED DATA AREA
49145 LD (60255),HL Skip over 32 bytes at 32819 (this data is unused)
49148 LD DE,32
49151 ADD HL,DE
FLIPPED/MIRRORED GRAPHICS
49152 LD (60257),HL Address pointer to flipped graphics store at 32851
MAROC'S INVENTORY SLOTS
49155 LD HL,(60346) Address pointer to start of Maroc's inventory (32626)
49158 LD (60348),HL Copy to current inventory address pointer
49161 LD DE,16 Advance 16 bytes to start of next inventory item address pointer
49164 ADD HL,DE
49165 LD (60350),HL And store (32642) in current game data
Prepare graphics for Maroc's sprite
49168 LD A,1
49170 LD (60240),A Graphics & frame offset (1 = no graphic address offset, start at frame #1) - sprite graphics pointer starts at 38851
49173 CALL 57538 Set up graphics
49176 LD HL,(60241) Store Maroc's calculated sprite graphic address pointer
49179 LD (60098),HL
49182 LD A,124 'Dummy' graphic address (44444) - used where nothing needs to be drawn/printed
49184 CALL 57538
49187 LD HL,(60241) Store calculated graphic address pointer
49190 LD (60147),HL
49193 LD A,123 Set up graphics for Maroc's shadow (at 44424)
49195 CALL 57538
49198 LD HL,(60241) Get Maroc's shadow's calculated sprite graphic address pointer
49201 LD (60100),HL ...and copy to game data store
49204 LD A,105 Set up flickering barrier graphics (43500) used for spells such as SHIELD, PROTECT and DEFENCE
49206 CALL 57538
49209 LD HL,(60241) Get the address pointer to these graphics
49212 LD (60566),HL ...and copy to the current game data store
Prev: 48992 Up: Map Next: 49215