Prev: 58863 Up: Map Next: 59174
58893: SETUP_GAME
Used by the routine PLAY_GAME.
SETUP_GAME 58893 LD IX,59789
58897 LD A,0
SETUP_GAME_0 58899 PUSH AF
58900 LD C,16
58902 CALL 8880 Call into ROM PIXEL-ADD routine (LD B,A)
58905 LD (IX+0),L Copy pixel address from HL to (IX) in reverse order. This address will be used by COPY_BUFFER_TO_SCREEN
58908 INC IX
58910 LD (IX+0),H
58913 INC IX
58915 POP AF
58916 INC A
58917 CP 128 Check bit 7
58919 JP NZ,SETUP_GAME_0
58922 XOR A Clear carry flag, set A to zero
58923 LD (59674),A
58926 LD (59786),A Clear L59786
58929 LD (59785),A Clear L59785
58932 LD (59666),A
58935 OUT (254),A
58937 LD HL,36864 Point HL at TILE_MAP
58940 LD (59783),HL Point TILE_MAP_ADDR at TILE_MAP
58943 LD B,16 Prepare to loop 16 times
58945 LD HL,60389 Point HL at the screen buffer
SETUP_GAME_1 58948 PUSH BC
58949 PUSH HL
58950 CALL L58392_1
58953 POP HL
58954 INC HL
58955 INC HL
58956 POP BC
58957 DJNZ SETUP_GAME_1 Loop 16 times
58959 LD A,32
58961 LD IX,59687
SETUP_GAME_2 58965 PUSH AF
58966 CALL L58863
58969 LD (IX+0),A
58972 INC IX
58974 CALL L58863
58977 AND 15
58979 LD (IX+0),A
58982 INC IX
58984 CALL L58863
58987 AND 3
58989 INC A
58990 LD (IX+0),64
SETUP_GAME_3 58994 RLC (IX+0)
58998 RLC (IX+0)
59002 DEC A
59003 JP NZ,SETUP_GAME_3
59006 INC IX
59008 POP AF
59009 DEC A
59010 JP NZ,SETUP_GAME_2
59013 LD HL,0
59016 LD (59671),HL
59019 LD HL,16384 Clear top two thirds of screen
59022 LD DE,16385
59025 LD BC,4095
59028 LD (HL),0
59030 LDIR
59032 LD A,70
59034 LD (59686),A
59037 LD HL,22528 Clear top two thirds of attributes
59040 LD DE,22529
59043 LD BC,511
59046 LD (HL),A
59047 LDIR
59049 LD A,1
59051 LD (59667),A
59054 LD H,16
59056 LD L,8
59058 LD (59649),HL Set default player position at PLAYER_X_COORD and PLAYER_Y_COORD
59061 XOR A Clear carry flag, set A to zero
59062 LD (59648),A
Disable upward-firing bullets
59065 LD HL,60081 Point HL at UP_BULLETS
59068 LD DE,60082
59071 LD BC,11
59074 LD (HL),255
59076 LDIR Set 60081-60091 to 255
Disable bullets
59078 LD HL,60093 Point HL at PLAYER_SHOTS
59081 LD DE,60094
59084 LD BC,47
59087 LD (HL),255
59089 LDIR Set 60093-60139 to 255
Disable something
59091 LD HL,60141
59094 LD DE,60142
59097 LD BC,95
59100 LD (HL),255
59102 LDIR Set 60141-60235 to 255
Disable enemies
59104 LD HL,60045 Point HL at ENEMY_DATA
59107 LD DE,60046
59110 LD BC,11
59113 LD (HL),255 Set 60045-60055 to 255
59115 LDIR
59117 LD A,31
59119 LD (59652),A
59122 LD A,255
59124 LD (59644),A
59127 XOR A Clear carry flag, set A to zero
59128 LD (59646),A
59131 LD (59645),A
59134 LD A,67
59136 LD (59653),A
59139 LD A,16
59141 LD (59675),A
59144 XOR A Clear carry flag, set A to zero
59145 LD (59678),A
59148 LD (59677),A
59151 LD (59682),A
59154 LD (59679),A
59157 LD HL,59174 Point HL at the end of game text
59160 LD (59680),HL Store the address of the end of game text in 59680
59163 LD A,50
59165 LD (59684),A
59168 LD A,20
59170 LD (59685),A
59173 RET
Prev: 58863 Up: Map Next: 59174