; The comment below dates back to July 1983 when this game was written. ; ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ; ; Rip - off 1 ; ; (c) Will Yums & Design Design Software ; ; Hacked together by ; ; Chewrubba and Mottly ; ; Interrupts always display 3/7/83 ; ; Invaders generator works 6/7/83 ; ; Defender decided . 8/7/83 ; ; TMove0 OK 13/7/83 ; ; Men added 14/7/83 ; ; TMove1 OK 14/7/83 ; ; ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ; This is a more colourful version I hacked together while playing with the source. ; ; Have fun ;) bRepeatFire equ true ; Let's have repeat fire emulate_spectrum "128K" ; So the *.z80 has the right markers in it pNFrame equ 0 ; VSdel equ 1 ; FSdel equ 2 ; Sdel equ 3 ; Mdel equ 30 ; Ldel equ 100 ; WSI equ 15 ; ScoreR equ 250 ; SdSpeed equ 2 ; if enabled bRepeatFire ; nLasers equ 10 ; Need more if we're repeating else ; nLasers equ 6 ; endif ; IntVecByte equ #80 ; IntRoutLoc equ IntVecByte*256 + IntVecByte ; CurSpeed equ 10 ; ScanRate equ 7 ; ; These are the positions on screen for various bits of text pScore equ $4000+5 ; pShips equ $4000+15 ; pShields equ $4700+16 ; pShieldAttr equ $5800+16 ; pBombs equ $4000+23 ; pMen equ $4000+30 ; pyAWC equ $4800 ; pxAWC equ $30 ; pyBON equ $4820 ; pxBON equ $30 ; pyChain equ $4860 ; pxChain equ $38 ; pyNXT equ $48A0 ; pxNXT equ $30 ; pyREP equ $4840 ; pxREP equ $40 ; pySPC equ $50E0 ; pxSPC equ $10 ; pnFrame equ $48B9 ; tw equ 64 ; TopLineAttr equ $07 ; RadarAttr equ $04 ; ; We start with the high-score table ; Note! The screen writing code sometimes write off the bottom of the screen. Don't put stuff there. ; It's messy, but stopping it would slow things down. org $7300 ; Somewhere well above BASIC and spurious writes AppFirst equ * ; ; Strings terminated by zero, followed by the score in four BCD digits HighScores db "Speaker to Animals",0,$00,$01; db "Kickaha",0,$00,$01 ; db "Muad'Dib ",0,$01,$00 ; db "Sleepery Jeem",0,$01,$00 ; db "Verkan Vall",0,$01,$00 ; db "Czar Murdicog the Headless",0,$01,$00; db "Erekos~",0,$01,$00 ; db "Greatheart Silver",0,$01,$00; db "Beowulf",0,$01,$00 ; db "Pirx",0,$01,$00 ; db "Sgt. Pinback",0,$01,$00 ; db "Bink",0,$01,$00 ; db "Little Fuzzy",0,$01,$00 ; db "Jake and Elwood",0,$01,$00 ; db "P.Cretin",0,$01,$00 ; db "No Messy Hex",0,$01,$00 ; ; This is then followed by this joke text ; Note - there needs to be room here so the users can give long highscore entries ; So this doesn't waste any space... db "Stop looking in my program !",0,$01,$00; db "I never wanted to be a programmer",0,$01,$00; db "I always wanted to be a ...",0,$01,$00; db "(a) Sex Aid",0,$01,$00 ; db "(b) Lumberjack",0,$01,$00 ; db "(c) Hedgehog",0,$01,$00 ; db "(d) Cheese cake",0,$01,$00 ; db "(e) Father",0,$01,$00 ; db "Answers on a postcard please to",0,$01,$00; db "Simon Brattel",0,$01,$00 ; db "& Neil Mottershead",0,$01,$00; db "This program is copyright ( but not by us )",0,$01,$00; db "ANNOUNCEMENT",0,$01,$00 ; db "This space has been rented by the Design-Design",0,$01,$00; db "marriage guidance bureau .",0,$01,$00; db "TWO aging depressed (depressing) programmers",0,$01,$00; db "{ soon to be certified }",0,$01,$00; db "seek female company with a view to establishing",0,$01,$00; db "an extremely verbose relationship .",0,$01,$00; db "Translation :- 'Love amongst the cheese cakes'",0,$01,$00; db "(Fruit cakes)",0,$01,$00 db "END OF ANNOUNCEMENT",0,$01,$00; db "PS Lavernia's massage parlour has moved to",0,$01,$00; db " 125 Smedley Rd Cheetham Hill ",$B8,"/",$89,0,$01,$00; db " Tel. 061 205 6603 and ask for Joe",0,$01,$00; db "PSS This game owes its existance to :-",0,$01,$00; // PSS is a joke, not a misprint db " (53) 2-Litre coke bottles",0,$01,$00; db " (6) Greens Original Cheese Cakes",0,$01,$00; db " (24) Very hot curries",0,$01,$00; db " (4) 600 K floppy discs",0,$01,$00; db " (100000) Neurons",0,$01,$00; db " (1) Another Greens Original",0,$01,$00; db " (4) 1/2 pint glasses",0,$01,$00 db " (98) kWh of t'electric",0,$01,$00; db " (2*4*10^6*60*60*10*49) T-States",0,$01,$00; db " and finally",0,$01,$00; db " (980) misery filled hours of wasted effort.",$00,$01,$00; db "PSSS We appologise for the awful noises",0,$01,$00; db " They weren't our idea",0,$01,$00 db "PSSSS Coming soon (we hope)",0,$01,$00; db " THE LOADER",0,$01,$00; db "... and so off they go into the dawn ...",0,$01,$00; db "... pausing only to reconstruct the Nascam ...",0,$01,$00; // Nascam is a joke, it's what we called Neil's Nascom2 db "... reinvent the keyboard ...",0,$01,$00; db "... resubmit the cheques ...",0,$01,$00; db "... think of the next line ...",0,$01,$00; db "But the cheese cake has arrived and so I must go...",0,$01,$00; db "10-4 (aaaaaaargh !)",0,$01,$00; db $22,"Is that the sort of thing you're after ?",$22,0,$01,$00; db $22,"Yes I think we can use that.",$22,0,$01,$00; db "LINK",0,$FF,$FF ; ; Character set - bits and pieces of other games in here ;) align 256 ; Cset dg --###--- ; dg --###--- ; dg #--#--#- ; dg -#####-- ; dg --###--- ; dg -#####-- ; dg --#-#--- ; dg -##-##-- ; dg --#----- ; dg -------- ; dg #---#--- ; dg -#---#-- ; dg --#---#- ; dg ---#---# ; dg ----#--- ; dg -----#-- ; dg ---#---- ; dg ----#--- ; dg -----#-- ; dg #-----#- ; dg -#-----# ; dg --#----- ; dg ---#---- ; dg ----#--- ; dg ----#--- ; dg -----#-- ; dg ------#- ; dg -------# ; dg #------- ; dg -#------ ; dg --#----- ; dg ---#---- ; dg -----#-- ; dg ------#- ; dg -------# ; dg -------- ; dg -------- ; dg #------- ; dg -#------ ; dg --#----- ; dg ------#- ; dg -------# ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg #------- ; dg -#------ ; dg -------# ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg #------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg ##------ ; dg ##------ ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -##----- ; dg #--#---- ; dg #--#---- ; dg -##----- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg ####---- ; dg #--#---- ; dg #--#---- ; dg ####---- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -##----- ; dg ####---- ; dg ####---- ; dg -##----- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg ####---- ; dg ####---- ; dg ####---- ; dg ####---- ; dg -------- ; dg -------- ; dg -------- ; dg ##------ ; dg ##------ ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -##----- ; dg #--#---- ; dg #--#---- ; dg -##----- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg ####---- ; dg #--#---- ; dg #--#---- ; dg ####---- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -##----- ; dg ####---- ; dg ####---- ; dg -##----- ; dg -------- ; dg -------- ; ; Chars dg -------- ; dg -------- ; dg ####---- ; dg ####---- ; dg ####---- ; dg ####---- ; dg -------- ; dg -------- ; dg ##------ ; dg ##------ ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -##----- ; dg #--#---- ; dg #--#---- ; dg -##----- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg ####---- ; dg #--#---- ; dg #--#---- ; dg ####---- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -##----- ; dg ####---- ; dg ####---- ; dg -##----- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg ####---- ; dg ####---- ; dg ####---- ; dg ####---- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg ######## ; dg -------- ; dg -------- ; dg ######## ; dg ######## ; dg -------- ; dg -------- ; dg ######## ; dg #--##--# ; dg #--##--# ; dg #--##--# ; dg #--##--# ; dg #--##--# ; dg #--##--# ; dg #--##--# ; dg #--##--# ; dg -------- ; dg -------- ; dg ###----- ; dg ---#---- ; dg ----#--- ; dg ##---#-- ; dg --#--#-- ; dg --#--#-- ; dg -------- ; dg -------- ; dg ######## ; dg -------- ; dg -------- ; dg ##----## ; dg --#--#-- ; dg --#--#-- ; dg --#--#-- ; dg --#--#-- ; dg ##---#-- ; dg -----#-- ; dg -----#-- ; dg ##---#-- ; dg --#--#-- ; dg --#--#-- ; dg -------- ; dg -------- ; dg #------- ; dg #------- ; dg #------- ; dg #------- ; dg -------- ; dg -------- ; dg ####---- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg ---##--- ; dg ---##--- ; dg --####-- ; dg ######## ; dg ######## ; dg ######## ; dg ######## ; dg ######## ; dg -------- ; dg -------- ; dg -------- ; dg #####--- ; dg ######-- ; dg ######-- ; dg ######-- ; dg ######-- ; dg #####--- ; dg ##------ ; dg #-#----- ; dg #--#---- ; dg #---#--- ; dg -----#-- ; dg ------#- ; dg -------# ; ; Chars dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg #------- ; dg #------- ; dg #------- ; dg #------- ; dg #------- ; dg -------- ; dg #------- ; dg -------- ; dg #-#----- ; dg #-#----- ; dg #-#----- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -#-#---- ; dg -#-#---- ; dg #####--- ; dg -#-#---- ; dg #####--- ; dg -#-#---- ; dg -#-#---- ; dg -------- ; dg --#----- ; dg -####--- ; dg #-#----- ; dg -###---- ; dg --#-#--- ; dg ####---- ; dg --#----- ; dg -------- ; dg ##------ ; dg ##--#--- ; dg ---#---- ; dg --#----- ; dg -#------ ; dg #--##--- ; dg ---##--- ; dg -------- ; dg -#------ ; dg #-#----- ; dg #-#----- ; dg -#------ ; dg #-#-#--- ; dg #--#---- ; dg -##-#--- ; dg -------- ; dg #------- ; dg #------- ; dg #------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg --#----- ; dg -#------ ; dg #------- ; dg #------- ; dg #------- ; dg -#------ ; dg --#----- ; dg -------- ; dg #------- ; dg -#------ ; dg --#----- ; dg --#----- ; dg --#----- ; dg -#------ ; dg #------- ; dg -------- ; dg --#----- ; dg #-#-#--- ; dg -###---- ; dg --#----- ; dg -###---- ; dg #-#-#--- ; dg --#----- ; dg -------- ; dg -------- ; dg --#----- ; dg --#----- ; dg #####--- ; dg --#----- ; dg --#----- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -#------ ; dg -#------ ; dg #------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg #####--- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg #------- ; dg -------- ; dg -------- ; dg ----#--- ; dg ---#---- ; dg --#----- ; dg -#------ ; dg #------- ; dg -------- ; dg -------- ; ; Chars dg -###---- ; dg #---#--- ; dg #--##--- ; dg #-#-#--- ; dg ##--#--- ; dg #---#--- ; dg -###---- ; dg -------- ; dg -#------ ; dg ##------ ; dg -#------ ; dg -#------ ; dg -#------ ; dg -#------ ; dg ###----- ; dg -------- ; dg -###---- ; dg #---#--- ; dg ----#--- ; dg --##---- ; dg -#------ ; dg #------- ; dg #####--- ; dg -------- ; dg #####--- ; dg ----#--- ; dg ---#---- ; dg --##---- ; dg ----#--- ; dg #---#--- ; dg -###---- ; dg -------- ; dg ---#---- ; dg --##---- ; dg -#-#---- ; dg #--#---- ; dg #####--- ; dg ---#---- ; dg ---#---- ; dg -------- ; dg #####--- ; dg #------- ; dg ####---- ; dg ----#--- ; dg ----#--- ; dg #---#--- ; dg -###---- ; dg -------- ; dg --###--- ; dg -#------ ; dg #------- ; dg ####---- ; dg #---#--- ; dg #---#--- ; dg -###---- ; dg -------- ; dg #####--- ; dg ----#--- ; dg ---#---- ; dg --#----- ; dg -#------ ; dg -#------ ; dg -#------ ; dg -------- ; dg -###---- ; dg #---#--- ; dg #---#--- ; dg -###---- ; dg #---#--- ; dg #---#--- ; dg -###---- ; dg -------- ; dg -###---- ; dg #---#--- ; dg #---#--- ; dg -####--- ; dg ----#--- ; dg ---#---- ; dg ###----- ; dg -------- ; dg -------- ; dg -------- ; dg #------- ; dg -------- ; dg #------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -#------ ; dg -------- ; dg -#------ ; dg -#------ ; dg #------- ; dg -------- ; dg ---#---- ; dg --#----- ; dg -#------ ; dg #------- ; dg -#------ ; dg --#----- ; dg ---#---- ; dg -------- ; dg -------- ; dg -------- ; dg #####--- ; dg -------- ; dg #####--- ; dg -------- ; dg -------- ; dg -------- ; dg #------- ; dg -#------ ; dg --#----- ; dg ---#---- ; dg --#----- ; dg -#------ ; dg #------- ; dg -------- ; dg -###---- ; dg #---#--- ; dg ---#---- ; dg --#----- ; dg --#----- ; dg -------- ; dg --#----- ; dg -------- ; ; Chars dg -###---- ; dg #---#--- ; dg #-#-#--- ; dg #-###--- ; dg #-##---- ; dg #------- ; dg -####--- ; dg -------- ; dg --#----- ; dg -#-#---- ; dg #---#--- ; dg #---#--- ; dg #####--- ; dg #---#--- ; dg #---#--- ; dg -------- ; dg ####---- ; dg #---#--- ; dg #---#--- ; dg ####---- ; dg #---#--- ; dg #---#--- ; dg ####---- ; dg -------- ; dg -###---- ; dg #---#--- ; dg #------- ; dg #------- ; dg #------- ; dg #---#--- ; dg -###---- ; dg -------- ; dg ####---- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg ####---- ; dg -------- ; dg #####--- ; dg #------- ; dg #------- ; dg ####---- ; dg #------- ; dg #------- ; dg #####--- ; dg -------- ; dg #####--- ; dg #------- ; dg #------- ; dg ####---- ; dg #------- ; dg #------- ; dg #------- ; dg -------- ; dg -####--- ; dg #------- ; dg #------- ; dg #------- ; dg #--##--- ; dg #---#--- ; dg -####--- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #####--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -------- ; dg ###----- ; dg -#------ ; dg -#------ ; dg -#------ ; dg -#------ ; dg -#------ ; dg ###----- ; dg -------- ; dg ----#--- ; dg ----#--- ; dg ----#--- ; dg ----#--- ; dg ----#--- ; dg #---#--- ; dg -###---- ; dg -------- ; dg #---#--- ; dg #--#---- ; dg #-#----- ; dg ##------ ; dg #-#----- ; dg #--#---- ; dg #---#--- ; dg -------- ; dg #------- ; dg #------- ; dg #------- ; dg #------- ; dg #------- ; dg #------- ; dg #####--- ; dg -------- ; dg #---#--- ; dg ##-##--- ; dg #-#-#--- ; dg #-#-#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg ##--#--- ; dg #-#-#--- ; dg #--##--- ; dg #---#--- ; dg #---#--- ; dg -------- ; dg -###---- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -###---- ; dg -------- ; ; Chars dg ####---- ; dg #---#--- ; dg #---#--- ; dg ####---- ; dg #------- ; dg #------- ; dg #------- ; dg -------- ; dg -###---- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #-#-#--- ; dg #--#---- ; dg -##-#--- ; dg -------- ; dg ####---- ; dg #---#--- ; dg #---#--- ; dg ####---- ; dg #-#----- ; dg #--#---- ; dg #---#--- ; dg -------- ; dg -###---- ; dg #---#--- ; dg #------- ; dg -###---- ; dg ----#--- ; dg #---#--- ; dg -###---- ; dg -------- ; dg #####--- ; dg --#----- ; dg --#----- ; dg --#----- ; dg --#----- ; dg --#----- ; dg --#----- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -###---- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -#-#---- ; dg --#----- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #-#-#--- ; dg #-#-#--- ; dg ##-##--- ; dg #---#--- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg -#-#---- ; dg --#----- ; dg -#-#---- ; dg #---#--- ; dg #---#--- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg -#-#---- ; dg --#----- ; dg --#----- ; dg --#----- ; dg --#----- ; dg -------- ; dg #####--- ; dg ----#--- ; dg ---#---- ; dg --#----- ; dg -#------ ; dg #------- ; dg #####--- ; dg -------- ; dg #####--- ; dg ##------ ; dg ##------ ; dg ##------ ; dg ##------ ; dg ##------ ; dg #####--- ; dg -------- ; dg -------- ; dg #------- ; dg -#------ ; dg --#----- ; dg ---#---- ; dg ----#--- ; dg -------- ; dg -------- ; dg #####--- ; dg ---##--- ; dg ---##--- ; dg ---##--- ; dg ---##--- ; dg ---##--- ; dg #####--- ; dg -------- ; dg --#----- ; dg -###---- ; dg #-#-#--- ; dg --#----- ; dg --#----- ; dg --#----- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg #####--- ; dg -------- ; ; Chars dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -------- ; dg -##-#--- ; dg #--##--- ; dg #---#--- ; dg #--##--- ; dg -##-#--- ; dg -------- ; dg #------- ; dg #------- ; dg #-##---- ; dg ##--#--- ; dg #---#--- ; dg ##--#--- ; dg #-##---- ; dg -------- ; dg -------- ; dg -------- ; dg -####--- ; dg #------- ; dg #------- ; dg #------- ; dg -####--- ; dg -------- ; dg ----#--- ; dg ----#--- ; dg -##-#--- ; dg #--##--- ; dg #---#--- ; dg #--##--- ; dg -##-#--- ; dg -------- ; dg -------- ; dg -------- ; dg -###---- ; dg #---#--- ; dg #####--- ; dg #------- ; dg -###---- ; dg -------- ; dg --#----- ; dg -#------ ; dg -#------ ; dg ###----- ; dg -#------ ; dg -#------ ; dg -#------ ; dg -------- ; dg -------- ; dg -------- ; dg -####--- ; dg #---#--- ; dg #--##--- ; dg -##-#--- ; dg ----#--- ; dg -###---- ; dg #------- ; dg #------- ; dg ####---- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -------- ; dg #------- ; dg -------- ; dg #------- ; dg #------- ; dg #------- ; dg #------- ; dg #------- ; dg -------- ; dg -------- ; dg --#----- ; dg -------- ; dg --#----- ; dg --#----- ; dg --#----- ; dg --#----- ; dg ##------ ; dg #------- ; dg #------- ; dg #--#---- ; dg #-#----- ; dg ###----- ; dg #--#---- ; dg #---#--- ; dg -------- ; dg ##------ ; dg -#------ ; dg -#------ ; dg -#------ ; dg -#------ ; dg -#------ ; dg ###----- ; dg -------- ; dg -------- ; dg -------- ; dg ##-#---- ; dg #-#-#--- ; dg #-#-#--- ; dg #-#-#--- ; dg #-#-#--- ; dg -------- ; dg -------- ; dg -------- ; dg ####---- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -------- ; dg -------- ; dg -------- ; dg -###---- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -###---- ; dg -------- ; ; Chars dg -------- ; dg -------- ; dg ####---- ; dg #---#--- ; dg #---#--- ; dg ####---- ; dg #------- ; dg #------- ; dg -------- ; dg -------- ; dg -####--- ; dg #---#--- ; dg #---#--- ; dg -####--- ; dg ----#--- ; dg ----#--- ; dg -------- ; dg -------- ; dg #-##---- ; dg ##------ ; dg #------- ; dg #------- ; dg #------- ; dg -------- ; dg -------- ; dg -------- ; dg -####--- ; dg #------- ; dg -###---- ; dg ----#--- ; dg ####---- ; dg -------- ; dg -------- ; dg --#----- ; dg #####--- ; dg --#----- ; dg --#----- ; dg --#----- ; dg ---##--- ; dg -------- ; dg -------- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg -####--- ; dg -------- ; dg -------- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg -#-#---- ; dg -#-#---- ; dg --#----- ; dg -------- ; dg -------- ; dg -------- ; dg #---#--- ; dg #---#--- ; dg #---#--- ; dg #-#-#--- ; dg -#-#---- ; dg -------- ; dg -------- ; dg -------- ; dg #---#--- ; dg -#-#---- ; dg --#----- ; dg -#-#---- ; dg #---#--- ; dg -------- ; dg -------- ; dg -------- ; dg #--#---- ; dg #--#---- ; dg #--#---- ; dg ####---- ; dg ---#---- ; dg ###----- ; dg -------- ; dg -------- ; dg #####--- ; dg ---#---- ; dg --#----- ; dg -#------ ; dg #####--- ; dg -------- ; dg --##---- ; dg -#------ ; dg -#------ ; dg #------- ; dg -#------ ; dg -#------ ; dg --##---- ; dg -------- ; dg -------- ; dg #------- ; dg #------- ; dg -------- ; dg -------- ; dg #------- ; dg #------- ; dg -------- ; dg ##------ ; dg --#----- ; dg --#----- ; dg ---#---- ; dg --#----- ; dg --#----- ; dg ##------ ; dg -------- ; dg -#-#---- ; dg -------- ; dg -###---- ; dg #---#--- ; dg #####--- ; dg #------- ; dg -###---- ; dg -------- ; dg -------- ; dg -------- ; dg ----#--- ; dg -###---- ; dg #------- ; dg -------- ; dg -------- ; dg -------- ; ; The widths of the characters above Wset db $07,$09,$09,$09,$09,$09,$09,$03 ; ........ db $05,$05,$05,$05,$03,$05,$05,$05 ; ........ db $05,$03,$05,$05,$05,$05,$09,$09 ; ........ db $07,$09,$07,$02,$05,$09,$07,$09 ; ........ db $06,$02,$04,$06,$06,$06,$06,$02 ; ........ db $04,$04,$06,$06,$03,$06,$02,$06 ; ........ db $06,$04,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$02,$03,$05,$06,$05,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$04,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$04,$06 ; ........ db $06,$02,$04,$06,$04,$06,$06,$06 ; ........ db $06,$06,$05,$06,$06,$06,$06,$06 ; ........ db $06,$05,$06,$05,$02,$05,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ db $06,$06,$06,$06,$06,$06,$06,$06 ; ........ mSoundSMC macro() nop mend ; Start the code in fast memory org #8000 ; ; The game was originally assembled from two different sources, and used this jump table ; to link routines between them, so during development we could load the binary for one ; of them while working on the source for the other. IOptrs equ * ; vKL jp KL ; The keyboard/joystick-reading routines. vKR jp KR ; vKU jp KU ; vKD jp KD ; vKS jp KS ; vKF jp KF ; CallHL jp (hl) ; CallDE push de ; Ret ret ; CallBC push bc ; ret ; PTab defb #80,#40,#20,#10,8,4,2,1 ; 0..7 -> graphic bit table KScan push bc ; call vKL ; jr nz $+7 ; ld a,1 ; ld (LeftF),a ; call vKR ; jr nz $+7 ; ld a,1 ; ld (RightF),a ; call vKU ; jr nz $+7 ; ld a,1 ; ld (UpF),a ; call vKD ; jr nz $+7 ; ld a,1 ; ld (DownF),a ; pop bc ; ret ; if * > IntRoutLoc ; zeuserror "The interrupt vector is overwriting code!"; endif ; org IntRoutLoc ; jp SInt ; IntVec equ *-2 ; StackSp defw 0 ; SInt di ; push af ; call KScan ; push bc ; call CheckFire ; call CheckSmart ; pop bc ; ld a,(nInts) ; inc a ; ld (nInts),a ; ld a,(SRt) ; dec a ; ld (SRt),a ; jr z StepScreen ; call MSp ; call KScan ; pop af ; ei ; ret ; AddressT defw PutTT,PutMT,PutBT,PutTM,PutMM,PutBM; defw PutTB,PutMB,PutBB ; StepScreen push hl ; call MSp ; ld hl,(pRateTl) ; ld a,(hl) ; and $07 ; jr nz SSM ; inc a ; SSM ld (SRt),a ; pop hl ; call KScan ; pop af ; ei ; ret ; align 256 ; GarbCopy defb #C0,#30,#0C,#03 ; 0..3 -> pair of graphic pixels BVec defw BbSp,BbSp1,BbSp,BbSp1 ; Start di ; im 2 ; push iy ; push ix ; push hl ; push de ; push bc ; push af ; exx ; push hl ; push de ; push bc ; push af ; ld (StackSp),sp ; call CLS ; call InitDisp ; call DefInts ; call DefRate ; TEntry call CrTl ; call ClTgs ; call PlRest ; call ClLrs ; call InitEx ; ld hl,Predef ; ld de,pNewPos ; ld bc,(PredefE-Predef)+1 ; ldir ; call InitScreen ; ld a,5 ; ld (KeyS),a ; TLoop ei ; call HM ; Move things call GameLoop ; ld a,(EndF) ; or a ; jr z TLoop ; ; We're do, but why? ld a,(Killed) ; We we killed? or a ; jr z GameEnd ; No, skip ; We want to explode the ship call Explode ; GameEnd di ; ld sp,(StackSp) ; pop af ; pop bc ; pop de ; pop hl ; exx ; pop af ; pop bc ; pop de ; pop hl ; pop ix ; pop iy ; ld a,(Killed) ; ret ; HM ld a,(HS) ; dec a ; ld (HS),a ; ret nz ; ld (NoMoved),a ; ld hl,HMloopE1 ; ld (HVec),hl ; ld a,68 ; Thing speed? ld (HS),a ; ld ix,ThingTable ; ld b,36 ; HMloop push bc ; ld hl,HIntHand ; ld (IntVec),hl ; bit 0,(ix) ; jr nz HMloopE ; ld a,(ix+18) ; cp $11 ; jr c HML1 ; ld a,(NoMoved) ; inc a ; ld (NoMoved),a ; HML1 dec (ix+5) ; jr nz HMloopE ; ld a,(ix+6) ; ld (ix+5),a ; ld l,(ix+7) ; ld h,(ix+8) ; call CallHL ; call DoitAttrEx ; Set the attribute ld a,(ix+17) ; cp 8 ; =man jr nc HMloopE ; cp 2 ; jr z HM1 ; cp 3 ; jr z HMloopE ; cp 7 ; jr z HMloopE ; call ShootIN ; HMloopE jp HMloopE1 ; HVec equ *-2 ; HM1 call BombIN ; jr HMloopE ; HMloopE1 ld hl,SInt ; ld (IntVec),hl ; ld de,tw ; add ix,de ; pop bc ; djnz HMloop ; ld a,(NoMoved) ; ld (NoRem),a ; or a ; ret nz ; ld a,(Started) ; ld (EndF),a ; ret ; HIntHand push hl ; ld hl,HAInt ; ld (HVec),hl ; pop hl ; ret ; HAInt ld hl,SInt ; ld (IntVec),hl ; call SInt ; ld hl,HMloopE1 ; ld (HVec),hl ; jr HMloopE1 ; if enabled bRepeatFire ; CheckFire ld a,(Killed) ; Can't fire if we're dead or a ; jr nz CFNP ; call vKF ; jr nz CFNP ; ld a,(FireF1) ; or a ; jr nz decfire ; ld a,1 ; ld (FireF1),a ; ld (FireF),a ; ret ; CFNP xor a ; ld (FireF1),a ; ret ; ; Repeat fire decfire dec a ; ld (FireF1),a ; ret ; else ; CheckFire ld a,(Killed) ; Can't fire if we're dead or a ; jr nz CFNP ; call vKF ; jr nz CFNP ; ld a,(FireF1) ; or a ; ret nz ; ld a,1 ; ld (FireF1),a ; ld (FireF),a ; ret ; CFNP xor a ; ld (FireF1),a ; ret ; endif ; CheckSmart ld a,(Killed) ; Can't smart if we're dead or a ; jr nz CSNP ; call vKS ; jr nz CSNP ; ld a,(SmartF1) ; or a ; ret nz ; ld a,1 ; ld (SmartF1),a ; ld (SmartF),a ; ret ; CSNP xor a ; ld (SmartF1),a ; ret ; StepNPRight ld de,(pNewPos) ; ld hl,EndDTl ; or a ; sbc hl,de ; jr nz StepNPR1 ; ld de,DTl ; StepNPR1 ld hl,8 ; add hl,de ; ld (pNewPos),hl ; ld a,(nV0) ; inc a ; ld (nV0),a ; ret ; StepNPLeft push af ; ld de,(pNewPos) ; ld hl,DTl ; or a ; sbc hl,de ; jr nz StepNPL1 ; ld de,EndDTl ; StepNPL1 ld hl,-8 ; add hl,de ; ld (pNewPos),hl ; ld a,(nV0) ; dec a ; ld (nV0),a ; pop af ; ret ; DefRate ld hl,RateTl+1 ; ld de,RateTl-1 ; DRloop ld a,(hl) ; or $80 ; ld (de),a ; inc hl ; dec de ; cp $FF ; jr nz DRloop ; ld hl,RateTl ; ld (pRateTl),hl ; ret ; MShLeft ret z ; push af ; ld a,(SRt) ; or a ; jr nz MSL1 ; ld a,1 ; ld (nDir),a ; ld a,(Sp0) ; dec a ; ld (nSp0),a ; MSL1 pop af ; ret ; MShRight ret z ; push af ; ld a,(SRt) ; or a ; jr nz MSL1 ; ld a,0 ; ld (nDir),a ; ld a,(Sp0) ; inc a ; ld (nSp0),a ; pop af ; ret ; ClBigMaze ld hl,BigMaze ; ld de,BigMaze+1 ; ld bc,$17FF ; ld (hl),$00 ; ldir ; ret ; ; Remove the player from the map RemoveFromBM ld a,(SpY) ; ld b,a ; ld a,(Sp0) ; call ConBMXY ; ld a,(hl) ; Clear 7 bits of flags and $80 ; ld (hl),a ; inc l ; ld a,(hl) ; and $80 ; ld (hl),a ; ret ; ; Put the player in the map PlInBM ld a,(SpY) ; ld b,a ; ld a,(Sp0) ; call ConBMXY ; HL points at the ship's position PIBM1 ld a,(hl) ; Hit anything, LHS? and $7F ; call nz SpHit ; Yes inc l ; Hit anything, RHS? ld a,(hl) ; and $7F ; call nz SpHit ; ld a,(hl) ; Put the player in the map RHS or 2 ; ld (hl),a ; dec l ; ld a,(hl) ; Put the player in the map LHS or 2 ; ld (hl),a ; ret ; ; Convert A,B to HL A=X, B=Y ConBMXY ld l,a ; ld a,b ; and $1F ; add a,BigMaze/256 ; ld h,a ; ret ; ClDList xor a ; ld (SppyF),a ; ld a,(nSp0) ; ld b,a ; ld a,(Sp0) ; cp b ; call nz SetSppyF ; ld a,(nV0) ; ld b,a ; ld a,(V0) ; cp b ; call nz SetSppyF ; ld a,(nSpY) ; ld b,a ; ld a,(SpY) ; cp b ; call nz SetSppyF ; ld a,(oSpDirX) ; ld b,a ; ld a,(SpDirX) ; cp b ; call nz SetSppyF ; ld a,(SppyF) ; or a ; jr z ClDList1 ; call CalcSppy ; ld (SpAddr),hl ; ld (nSpSh),de ; ClDList1 ld a,(nV0) ; ld (V0),a ; ld a,(nSp0) ; ld (Sp0),a ; ld a,(nSpY) ; ld (SpY),a ; ld a,(nDir) ; ld (Dir),a ; ld a,(SpDirX) ; ld (oSpDirX),a ; ret ; PlDList ld a,(SppyF) ; or a ; ret z ; call CalcSppy ; push hl ; exx ; ld hl,(SpAddr) ; ld de,(nSpSh) ; push hl ; exx ; ld b,8 ; PDListLoop1 ld a,(de) ; xor (hl) ; ld (hl),a ; inc h ; inc de ; exx ; ld a,(de) ; xor (hl) ; ld (hl),a ; inc h ; inc de ; exx ; djnz PDListLoop1 ; exx ; ld b,8 ; pop hl ; inc l ; exx ; pop hl ; inc l ; exx ; PDListLoop2 ld a,(de) ; xor (hl) ; ld (hl),a ; inc h ; inc de ; exx ; ld a,(de) ; xor (hl) ; ld (hl),a ; inc h ; inc de ; exx ; djnz PDListLoop2 ; ret ; SpsAttr ld a,(SpY) ; Draw the ship's attributes ld l,a ; ld h,0 ; add hl,hl ; add hl,hl ; add hl,hl ; add hl,hl ; add hl,hl ; ld de,#5B00 ; or a ; ex de,hl ; sbc hl,de ; ld a,(V0) ; ld e,a ; ld a,(Sp0) ; sub e ; ld e,a ; ld d,0 ; add hl,de ; ld (hl),$47 ; inc l ; ld (hl),$47 ; ret ; SetSppyF ld a,1 ; ld (SppyF),a ; ret ; CalcSppy ld a,(V0) ; ld b,a ; ld a,(Sp0) ; sub b ; ld (SpX),a ; push af ; ld a,(SpY) ; ld l,a ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; ld e,(hl) ; inc hl ; ld d,(hl) ; pop af ; ld l,a ; ld h,0 ; add hl,de ; ld de,(cSpSh) ; ret ; PutSppy call CalcSppy ; ld b,8 ; push hl ; PDLloop ld a,(de) ; xor (hl) ; ld (hl),a ; inc h ; inc de ; djnz PDLloop ; pop hl ; ld b,8 ; inc l ; PDLloop1 ld a,(de) ; xor (hl) ; ld (hl),a ; inc h ; inc de ; djnz PDLloop1 ; pop af ; ret ; InitScreen ld iy,(pNewPos) ; ld de,0 ; ISloop ld l,(iy) ; ld h,(iy+1) ; add hl,de ; ld c,(iy+2) ; ld b,(iy+3) ; call CallBC ; ld bc,8 ; add iy,bc ; inc de ; ld a,e ; cp 32 ; jr nz ISloop ; call PutSppy ; ret ; ClTgs ld hl,ThingTable ; ld de,ThingTable+1 ; ld bc,$FFF ; ld (hl),1 ; ldir ; ld hl,pTgT ; ld de,pTgT+1 ; ld bc,$1FF ; ld (hl),$00 ; ldir ; ld b,64 ; There are 64 possible things ld hl,ThingTable ; ld de,tw ; ld ix,pTgT+1 ; ld iy,pTgT+$101 ; ClTloop ld (ix),l ; ld (iy),h ; add hl,de ; inc ix ; inc iy ; djnz ClTloop ; ret ; PlRest ld a,(nV0) ; ld c,a ; ld b,41 ; ld de,tw ; ld hl,ThingTable ; AlienLoop ld iy,0 ; bit 1,(hl) ; call nz Doit3 ; bit 0,(hl) ; jp nz NextAlien1 ; inc hl ; ld a,(hl) ; dec hl ; sub c ; cp 32 ; jr nc NextAlien1 ; call Doit ; NextAlien add hl,de ; djnz AlienLoop ; ret ; NextAlien1 bit 1,(hl) ; jr z NextAlien ; res 1,(hl) ; push hl ; push hl ; pop ix ; ld hl,Doit4 ; push hl ; ld l,(ix+3) ; ld h,(ix+4) ; push hl ; push iy ; pop hl ; ret ; Doit4 pop hl ; jr NextAlien ; ld h,(ix+4) ; ??? Doit push bc ; push de ; push hl ; push hl ; pop ix ; call DoitAttr ; ld l,(ix+2) ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; add a,(hl) ; inc hl ; ld h,(hl) ; ld l,a ; ld (ix+9),l ; ld (ix+10),h ; set 1,(ix) ; push iy ; pop de ; or a ; sbc hl,de ; jr z Doit1 ; add hl,de ; ld e,(ix+3) ; ld d,(ix+4) ; call CallDE ; ld de,Doit1 ; push de ; ld e,(ix+3) ; ld d,(ix+4) ; push de ; push iy ; pop hl ; ret ; Doit1 pop hl ; pop de ; pop bc ; ret ; DoitAttrEx ld a,(V0) ; ld e,a ; ld a,(ix+1) ; X sub e ; cp 32 ; On screen? ret nc ; No, exit ; A=X, draw the attribute DoitAttr push af ; A=X ld l,(ix+2) ; Y? ld h,0 ; add hl,hl ; * 32 add hl,hl ; add hl,hl ; add hl,hl ; add hl,hl ; ld de,#5B00 ; Attributes? ex de,hl ; or a ; sbc hl,de ; ld e,a ; ld d,0 ; add hl,de ; ld a,(ix+17) ; Is this a saucer? cp 4 ; ld a,(ix+19) ; Attribute ld (hl),a ; jr z DIA3 ; Yes it is a saucer, draw the attribute for the left and right side pop af ; ret ; DIA3 dec l ; Saucer side attributes ld (hl),a ; inc l ; inc l ; ld (hl),a ; pop af ; ret ; Doit3 push hl ; push hl ; pop ix ; ld a,(ix+9) ; ld iyl,a ; ld a,(ix+10) ; ld iyh,a ; pop hl ; ret ; ClRest ld a,(V0) ; ld c,a ; res 1,(ix) ; ld a,(ix+1) ; sub c ; cp 32 ; ret nc ; set 1,(ix) ; push de ; push hl ; push af ; ld l,(ix+2) ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; ld e,(hl) ; inc hl ; ld d,(hl) ; pop af ; ld l,a ; ld h,0 ; add hl,de ; ld (ix+9),l ; ld (ix+10),h ; pop hl ; pop de ; ret ; DSetRad ld l,(ix+34) ; ld h,(ix+35) ; ld a,(ix+36) ; xor (hl) ; ld (hl),a ; SetRad ld l,(ix+2) ; ld h,0 ; add hl,hl ; ld de,ConRT ; add hl,de ; ld a,(hl) ; ld (ix+32),a ; inc hl ; ld h,(hl) ; ld (ix+33),h ; ld l,a ; call RadWeld ; xor (hl) ; ld (hl),a ; ret ; RadWeld ld a,(Sp0) ; ld c,a ; ld a,(ix+1) ; sub c ; add a,#80 ; ld l,a ; and #7 ; ld c,a ; ld a,l ; rrca ; rrca ; rrca ; and #1F ; ld l,(ix+32) ; ld h,(ix+33) ; ld e,a ; ld d,0 ; add hl,de ; ld (ix+34),l ; ld (ix+35),h ; ld d,#80 ; ld a,c ; add a,PTab&#FF ; ld e,a ; ld a,(de) ; ld (ix+36),a ; ret ; GTS1 pop af ; ; Get a free space in the map GetTSpace ld a,r ; and #1F ; cp 20 ; ^ jr c GTS2 ; ld a,20 ; ^ GTS2 ld b,a ; ld a,r ; add a,a ; push af ; call ConBMXY ; ld a,(hl) ; or a ; jr nz GTS1 ; pop af ; ret ; ; Get a free man position (in X) GetMSpace ld a,r ; add a,a ; ld l,a ; ld h,ManH/256 ; bit 7,(hl) ; jr z GetMSpace ; res 7,(hl) ; dec (hl) ; ld a,l ; ld b,(hl) ; ret ; CrMan call FTTSMn ; ret c ; ld l,(iy+2) ; ld (ix+1),l ; ld a,(iy+1) ; ld (ix+2),a ; ld hl,ManSh ; ld (ix+3),l ; ld (ix+4),h ; ld a,66 ; ld (ix+6),a ; ld a,r ; and #3F ; add a,8 ; ld (ix+5),a ; ld hl,ManM ; ld (ix+7),l ; ld (ix+8),h ; ld (ix+#B),0 ; ld (ix+#E),0 ; ld a,(EntryNo) ; ld (ix+18),a ; ld (ix+17),8 ; Thing=man ld (ix+0),0 ; ld (ix+19),7 ; Colour=White ret ; FTTSMn push af ; xor a ; ld ix,ThingTable ; ld b,12 ; ld de,tw ; FTTS1 inc a ; bit 0,(ix) ; jr nz FTTS2 ; add ix,de ; djnz FTTS1 ; ld ix,0 ; pop af ; scf ; ret ; FTTS2 ld (EntryNo),a ; pop af ; or a ; ret ; FTTSTg push af ; ld a,16 ; ld ix,ThingTable+1024 ; ld b,20 ; ld de,tw ; jr FTTS1 ; FTTSPj push af ; ld a,36 ; ld iy,ThingTable+2048+256 ; ld b,5 ; ld de,tw ; Ftts1 inc a ; bit 0,(iy) ; jr nz Ftts2 ; add iy,de ; djnz Ftts1 ; ld iy,0 ; pop af ; scf ; ret ; Ftts2 ld (EntryNo),a ; pop af ; or a ; ret ; FTTSB push af ; ld a,12 ; ld iy,ThingTable+768 ; ld b,4 ; ld de,tw ; FttsB1 inc a ; bit 0,(iy) ; jr nz FttsB2 ; add iy,de ; djnz FttsB1 ; ld iy,0 ; pop af ; scf ; ret ; FttsB2 ld (EntryNo),a ; pop af ; or a ; ret ; TShTl defw TSh0 ; defw TM0 ; defw TSh1 ; defw TM1 ; defw TSh2 ; defw TM2 ; defw TSh3 ; defw TM2 ; defw TSh4 ; defw TM0 ; defw TSh0 ; defw TM0 ; defw TSh0 ; defw TM0 ; defw TSh0 ; defw TM0 ; TColTl defb #44 ; defb #45 ; defb #45 ; defb #43 ; TSh0 ld a,#3C ; xor (hl) ; ld (hl),a ; inc h ; ld a,#5A ; xor (hl) ; ld (hl),a ; inc h ; ld a,#99 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#99 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#7E ; xor (hl) ; ld (hl),a ; inc h ; ld a,#5A ; xor (hl) ; ld (hl),a ; inc h ; ld a,#DB ; xor (hl) ; ld (hl),a ; ret ; TSh1 ld a,#FC ; xor (hl) ; ld (hl),a ; inc h ; ld a,#84 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#BF ; xor (hl) ; ld (hl),a ; inc h ; ld a,#A1 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#A1 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#E1 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#21 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#3F ; xor (hl) ; ld (hl),a ; ret ; ManSh ld a,#38 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#38 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#92 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#7C ; xor (hl) ; ld (hl),a ; inc h ; ld a,#38 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#7C ; xor (hl) ; ld (hl),a ; inc h ; ld a,#28 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#6C ; xor (hl) ; ld (hl),a ; ret ; TSh2 ld a,#10 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#28 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#44 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#82 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#44 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#28 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#10 ; xor (hl) ; ld (hl),a ; ret ; TSh3 inc h ; ld a,#10 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#38 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#38 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#10 ; xor (hl) ; ld (hl),a ; ret ; TSh4a ld a,#03 ; xor (hl) ; ld (hl),a ; dec h ; ld a,#0E ; xor (hl) ; ld (hl),a ; dec h ; ld a,#03 ; xor (hl) ; ld (hl),a ; ret ; TSh4b ld a,#FF ; xor (hl) ; ld (hl),a ; inc h ; ld a,#AA ; xor (hl) ; ld (hl),a ; inc h ; ld a,#FF ; xor (hl) ; ld (hl),a ; ret ; TSh4c ld a,#80 ; xor (hl) ; ld (hl),a ; dec h ; ld a,#E0 ; xor (hl) ; ld (hl),a ; dec h ; ld a,#80 ; xor (hl) ; ld (hl),a ; ret ; TSh4 inc h ; inc h ; ld a,l ; and #1F ; jr z TSh4L ; cp #1F ; jr z TSh4R ; call TSh4b ; dec l ; call TSh4a ; inc l ; inc l ; inc h ; inc h ; jp TSh4c ; TSh4L call TSh4b ; inc l ; jp TSh4c ; TSh4R call TSh4b ; dec l ; jp TSh4a ; ManM ld a,(ix+#B) ; cp 2 ; ret c ; jr z MM2 ; ld l,(ix+1) ; ld e,(ix+2) ; ld h,MountH/256+1 ; ld (hl),e ; dec h ; ld a,(hl) ; sub e ; call z MMfd ; cp 1 ; jr nz MM1 ; ld a,e ; inc h ; ld a,(hl) ; and #80 ; or e ; ld (hl),a ; ld (ix+6),66 ; ld (ix+#B),0 ; ret ; MMfd ld b,a ; ld a,(ix+6) ; cp 15 ; ld a,b ; ret nc ; call AddEx ; call KillMan ; inc h ; ld (hl),#FF ; pop af ; bit 1,(ix) ; ld (ix),1 ; ret z ; ld l,(ix+9) ; ld h,(ix+10) ; jp ManSh ; MM1 dec (ix+2) ; dec (ix+6) ; MM1a ld a,(ix+2) ; inc h ; ld a,(hl) ; and #80 ; or (ix+2) ; ld (hl),a ; ret ; MM2 ld l,(ix+1) ; ld h,ManH/256 ; ld a,(hl) ; and #7F ; ld b,a ; dec h ; ld a,(hl) ; dec a ; cp b ; jr z MM2Fini ; jr c MM1 ; inc (ix+2) ; jr MM1a ; MM2Fini ld (ix+#B),0 ; ret ; TM0 ld l,(ix+#C) ; ld h,(ix+#D) ; ld a,(hl) ; and #80 ; ld (hl),a ; push hl ; pop hl ; ld a,(ix+#B) ; or a ; jr z TM0MAll ; cp 1 ; jp z TM0SwoopDown ; cp 2 ; jp z TM0CarryUp ; cp 3 ; jp z TM0Mutant ; jr TM0X ; TM0MAll ld l,(ix+1) ; ld e,(ix+2) ; ld h,MountH/256+1 ; bit 7,(hl) ; jr z TM0MAMF ; dec h ; call TM0MA0 ; ld a,e ; or a ; jp m TM0MAll ; cp 21 ; ^ jr nc TM0X ; ld a,BigMaze/256 ; add a,e ; ld h,a ; ld a,(hl) ; What's here cp 2 ; Player? call z SpHit ; or a ; jr nz TM0X ; ld (ix+1),l ; ld (ix+2),e ; TM0X1 ld (ix+#C),l ; ld (ix+#D),h ; TM0X ld l,(ix+#C) ; ld h,(ix+#D) ; ld a,(hl) ; or (ix+18) ; ld (hl),a ; MManX jp DSetRad ; ret ; TM0MAMF inc (ix+#B) ; set 7,(hl) ; call FindManEnt ; push iy ; pop hl ; ld (ix+#F),l ; Store a pointer to the man it's carrying ld (ix+#10),h ; ld (ix+6),30 ; jr TM0X ; ; Find a man at X=L FindManEnt ld iy,ThingTable ; ld b,37 ; ld de,tw ; FMEloop ld a,(iy+17) ; Thing type cp 8 ; Is man? jr nz FMEloopEnd ; bit 0,(iy+0) ; Dead? jr nz FMEloopEnd ; Yes, skip ld a,(iy+1) ; cp l ; ret z ; This one? FMEloopEnd add iy,de ; djnz FMEloop ; ld iy,0 ; ret ; TM0SwoopDown ld l,(ix+1) ; X? ld h,ManH/256 ; ld a,(hl) ; inc a ; jr z TM0SDX ; and #7F ; cp (ix+2) ; jr z TM0SDEnd ; jp p TM0X ; ld a,(ix+2) ; Thing's Y add a,BigMaze/256-1 ; ld h,a ; ld a,(hl) ; Read from map and #7F ; cp 2 ; Player? call z SpHit ; or a ; jr nz TM0X ; dec (ix+2) ; Move the Thing down jr TM0X1 ; TM0SDEnd inc (ix+#B) ; ld l,(ix+#F) ; pMan being carried, or thing carrying? ld h,(ix+#10) ; push hl ; pop iy ; ld (iy+#B),1 ; push ix ; pop hl ; ld (iy+#F),l ; Store a pointer to the man being carried ld (iy+#10),h ; jp TM0X ; TM0SDX ld (ix+#B),0 ; jp TM0X ; TM0CarryUp ld l,(ix+1) ; X ld a,(ix+2) ; Y cp 20 ; ^ jr z TM0CarryUpEnd ; Hit the sky add a,BigMaze/256+1 ; ld h,a ; ld a,(hl) ; and #7F ; cp 2 ; Player? call z SpHit ; or a ; jp nz TM0X ; inc (ix+2) ; Y++ push hl ; push ix ; ld l,(ix+#F) ; Point at the man it's carrying ld h,(ix+#10) ; push hl ; pop ix ; inc (ix+2) ; ld a,(ix+2) ; or #80 ; ld l,(ix+1) ; ld h,ManH/256 ; ld (hl),a ; pop ix ; pop hl ; jp TM0X1 ; ; A Thing carrying a man has reached the sky TM0CarryUpEnd inc (ix+#B) ; call KillMan ; Kill the man we're carrying ld (ix+6),1 ; ld (ix+19),#46 ; Bright yellow ld l,(ix+#F) ; Point at the man? ld h,(ix+#10) ; push ix ; push hl ; IX = pMan pop ix ; bit 1,(ix) ; ??? jr z TM0CE1 ; No, skip ld l,(ix+9) ; ld h,(ix+10) ; ld e,(ix+3) ; ld d,(ix+4) ; call CallDE ; res 1,(ix) ; TM0CE1 set 0,(ix+0) ; Kill it ld l,(ix+1) ; ld h,ManH/256 ; ld (hl),#FF ; Remove it from the manlist pop ix ; jp TM0X ; TM0Mutant call mkMutSd ; ld a,r ; cp #30 ; jr c SillyMutant ; call T0Mut ; MutCode ld a,d ; E=X, D=Y cp 1 ; jp c TM0X ; cp 21 ; ^ jp nc TM0X ; ld a,BigMaze/256 ; add a,d ; ld h,a ; ld l,e ; ld a,(hl) ; and #7F ; cp 2 ; Ship? call z SpHit ; Yes, kill it or a ; jp nz TM0X ; ld (ix+2),d ; ld (ix+1),e ; jp TM0X1 ; T0Mut ld a,(Sp0) ; sub (ix+1) ; ld e,a ; jp p T0Mut1 ; neg ; T0Mut1 ld b,a ; ld a,(SpY) ; sub (ix+2) ; ld d,a ; jr nc T0Mut2 ; neg ; T0Mut2 sub b ; jr c T0Mut3 ; ld e,(ix+1) ; bit 7,d ; ld d,(ix+2) ; jr nz T0Mut2A ; inc d ; inc d ; T0Mut2A dec d ; ret ; T0Mut3 ld d,(ix+2) ; bit 7,e ; ld e,(ix+1) ; jr nz T0Mut3A ; inc e ; inc e ; T0Mut3A dec e ; ret ; SillyMutant ld d,(ix+2) ; ld e,(ix+1) ; ; Randomly inc or dec Y ld a,r ; and #F ; ; Random Y bit 0,a ; jr nz,MCode2 ; bit 1,a ; jr nz,MCode1 ; dec d ; dec d ; MCode1 inc d ; ; Random Y MCode2 bit 2,a ; jp nz,MutCode ; bit 3,a ; jr nz,MCode3 ; dec e ; dec e ; MCode3 inc e ; jp MutCode ; TM0MA0 ld a,r ; and #7 ; cp 2 ; jr c TM0MA1b ; cp 3 ; jr c TM0MA1a ; ld a,(ix+#E) ; or a ; jr z TM0MA1 ; inc l ; inc l ; TM0MA1 dec l ; jr TM0MA1b ; TM0MA1a ld a,(ix+#E) ; or a ; jr nz TM0MA1 ; inc l ; TM0MA1b ld a,(hl) ; inc a ; inc a ; sub e ; jr z TM0MA2 ; jr c TM0MA3 ; inc e ; ret ; TM0MA2 ld a,r ; and #1 ; ret nz ; TM0MA4 inc e ; ret ; TM0MA3 ld a,r ; and #3 ; jr z TM0MA4 ; cp 1 ; ret z ; dec e ; ret ; TM1 ld l,(ix+#C) ; ld h,(ix+#D) ; ld a,(hl) ; and #80 ; ld (hl),a ; push hl ; ld b,(ix+1) ; ld l,(ix+2) ; pop hl ; call TM1Bomber ; ld a,BigMaze/256 ; add a,e ; ld h,a ; ld a,(hl) ; and #7F ; cp 2 ; call z SpHit ; or a ; jp nz TM0X ; ld a,(ix+1) ; ld (ix+37),a ; ld a,(ix+2) ; ld (ix+38),a ; ld a,(ix+#D) ; ld (ix+39),a ; ld (ix+1),l ; ld (ix+2),e ; jp TM0X1 ; TM1Bomber ld l,(ix+1) ; ld e,(ix+2) ; ld a,(ix+#E) ; or a ; jr nz TM1a ; inc l ; inc l ; TM1a dec l ; dec e ; ret nz ; ld e,20 ; ^ ret ; InvertCell0 ld b,(ix+1) ; ld l,(ix+2) ; InvertCell ld a,(V0) ; sub b ; neg ; cp 32 ; ret nc ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; add a,(hl) ; inc hl ; ld h,(hl) ; ld l,a ; ld e,(ix+3) ; ld d,(ix+4) ; push de ; ret ; InitLine ld (iy+20),1 ; ld (iy+21),1 ; ld a,l ; sub e ; ld l,a ; jp z ILine1A ; jp p ILine1 ; neg ; ld (iy+20),#FF ; ILine1 ld e,a ; ld a,h ; sub d ; ld h,a ; jp z ILine2A ; jp p ILine2 ; neg ; ld (iy+21),#FF ; ILine2 ld d,a ; sub e ; jr nc ILine3 ; ld (iy+22),e ; ld (iy+25),e ; sra e ; ld (iy+23),e ; ld (iy+24),d ; ld a,(iy+20) ; ld (iy+26),a ; ld (iy+27),0 ; inc (iy+22) ; ret ; ILine3 ld (iy+22),d ; ld (iy+25),d ; sra d ; ld (iy+23),d ; ld (iy+24),e ; ld a,(iy+21) ; ld (iy+27),a ; ld (iy+26),0 ; inc (iy+22) ; ret ; ILine1A ld (iy+20),0 ; jr ILine1 ; ILine2A ld (iy+21),0 ; jr ILine2 ; NextPoint dec (ix+22) ; jr nz NextPointA ; scf ; ret ; NextPointA ld a,(ix+23) ; sub (ix+24) ; ld (ix+23),a ; jp p NextPoint1 ; ld a,(ix+28) ; add a,(ix+20) ; ld (ix+28),a ; ld l,a ; ld a,(ix+29) ; add a,(ix+21) ; ld (ix+29),a ; ld h,a ; ld a,(ix+23) ; add a,(ix+25) ; ld (ix+23),a ; or a ; ret ; NextPoint1 ld a,(ix+28) ; add a,(ix+26) ; ld (ix+28),a ; ld l,a ; ld a,(ix+29) ; add a,(ix+27) ; ld (ix+29),a ; ld h,a ; or a ; ret ; ShootIN ld a,(Sp0) ; sub (ix+1) ; jp p Sh1 ; neg ; Sh1 cp 40 ; ret nc ; call FTTSPj ; ret c ; call mkProjSd ; ld a,(Sp0) ; sub (ix+1) ; ld l,a ; ld a,(SpY) ; ld h,a ; ld d,(ix+2) ; ld e,0 ; call InitLine ; ld (iy+28),2 ; ld (iy+29),2 ; ld a,(ix+1) ; ld (iy+30),a ; ld (iy+1),a ; ld a,(ix+2) ; ld (iy+31),a ; ld (iy+2),a ; ld (iy+5),1 ; ld (iy+6),1 ; ld (iy+3),PjSh1&#FF ; ld (iy+4),PjSh1/256 ; ld (iy+7),ProjM&#FF ; ld (iy+8),ProjM/256 ; ld (iy+17),9 ; ld (iy+0),0 ; ld (iy+19),#46 ; Bright Yellow? ld a,r ; and #78 ; jr z ShootIN1 ; ld (iy+22),118 ; ShootINRet push ix ; push iy ; pop ix ; call NextP ; call nc DoP ; pop ix ; ret ; ShootIN1 sla (iy+20) ; sla (iy+21) ; sla (iy+26) ; sla (iy+27) ; ld (iy+22),56 ; jr ShootINRet ; ShootIN2 ld a,(iy+20) ; add a,a ; add a,(iy+20) ; ld (iy+20),a ; ld a,(iy+21) ; add a,a ; add a,(iy+21) ; ld (iy+21),a ; ld a,(iy+26) ; add a,a ; add a,(iy+26) ; ld (iy+26),a ; ld a,(iy+27) ; add a,a ; add a,(iy+27) ; ld (iy+27),a ; ld (iy+22),38 ; jr ShootINRet ; ProjM bit 1,(ix) ; jr z ProjM2 ; ld l,(ix+9) ; ld h,(ix+10) ; res 1,(ix) ; call PjSh ; ProjM2 call NextP ; jr nc DoP ; ProjM1 set 0,(ix+0) ; ret ; DoP ld a,(V0) ; ld b,a ; ld a,(ix+1) ; sub b ; cp 32 ; ret nc ; ld l,(ix+2) ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; add a,(hl) ; inc hl ; ld h,(hl) ; ld l,a ; ld (ix+9),l ; ld (ix+10),h ; set 1,(ix) ; call PjSh ; ld a,(SpY) ; cp (ix+2) ; ret nz ; ld a,(Sp0) ; sub (ix+1) ; neg ; cp 2 ; ret nc ; SpHit push af ; ld a,(Shields) ; or a ; None? jr z SpHit1 ; dec a ; ld (Shields),a ; jr nz SpHitX ; SpHit1 ld a,1 ; ld (Killed),a ; Set this to kill the player ld (EndF),a ; xor a SpHitX srl a ; ; 7..0 push hl ; Clear it down... push bc ; ld hl,pShields ; neg ; add a,h ; 7.. ld h,a ; ld (hl),$00 ; pop bc ; pop hl ; pop af ; ret ; InitShieldDisplay ld hl,pShields ; ld b,8 ; ISD_Lp ld (hl),$FF ; dec h ; djnz ISD_Lp ; ld a,$11 ; ld (pShieldAttr),a ; ret ; Done NextP call NextPoint ; ret c ; ld a,(ix+28) ; sra a ; sra a ; add a,(ix+30) ; ld (ix+1),a ; ld a,(ix+29) ; sra a ; sra a ; add a,(ix+31) ; ld (ix+2),a ; or a ; jp p NextP1 ; scf ; ret ; NextP1 cp 21 ; ^ ccf ; ret ; PjSh ld a,(ix+29) ; and 3 ; add a,a ; sub h ; neg ; add a,6 ; ld h,a ; ld a,(ix+28) ; and 3 ; ld e,a ; ld d,GarbCopy/256 ; ld a,(de) ; xor (hl) ; ld (hl),a ; inc h ; ld a,(de) ; xor (hl) ; ld (hl),a ; PjSh1 ret ; MoveProj ld ix,ThingTable+2048+256 ; ld b,5 ; MovPj bit 0,(ix+0) ; jr nz MovPj1 ; dec (ix+5) ; jr nz MovPj1 ; ld a,(ix+6) ; ld (ix+5),a ; push bc ; call ProjM ; pop bc ; MovPj1 ld de,tw ; add ix,de ; djnz MovPj ; ret ; BombIN ld a,r ; and 7 ; ret nz ; call FTTSB ; ret c ; ld l,(ix+37) ; ld (iy+#C),l ; ld h,(ix+39) ; ld (iy+#D),h ; ld a,(hl) ; or a ; ret nz ; ld (iy),0 ; ld (iy+#11),10 ; ld a,(EntryNo) ; ld (iy+18),a ; or (hl) ; ld (hl),a ; ld (iy+19),#45 ; Bright Cyan ld (iy+#E),40 ; ld (iy+5),15 ; ld (iy+6),20 ; ld (iy+3),BbSp&#FF ; ld (iy+4),BbSp/256 ; ld (iy+7),BbM&#FF ; ld (iy+8),BbM/256 ; ld b,(ix+37) ; ld (iy+1),b ; ld l,(ix+38) ; ld (iy+2),l ; ret ; ; Code to draw a bomber/swarm? (big) BbSp inc h ; inc h ; ld a,(hl) ; xor #3C ; ld (hl),a ; inc h ; ld a,(hl) ; xor #24 ; ld (hl),a ; inc h ; ld a,(hl) ; xor #24 ; ld (hl),a ; inc h ; ld a,(hl) ; xor #3C ; ld (hl),a ; ret ; ; Code to draw a bomber/swarm (small) BbSp1 inc h ; inc h ; inc h ; ld a,(hl) ; xor #18 ; ld (hl),a ; inc h ; ld a,(hl) ; xor #18 ; ld (hl),a ; ret ; BbM ld l,(ix+12) ; ld h,(ix+13) ; ld a,(ix+18) ; or (hl) ; ld (hl),a ; ld l,(ix+9) ; ld h,(ix+10) ; ld e,(ix+3) ; ld d,(ix+4) ; bit 1,(ix) ; call nz CallDE ; ld a,(ix+11) ; inc a ; and $03 ; ld (ix+11),a ; add a,a ; add a,$04 ; ld l,a ; ld h,$81 ; ld a,(hl) ; ld (ix+3),a ; inc l ; ld a,(hl) ; ld (ix+4),a ; dec (ix+14) ; jp nz BbM1 ; ld l,(ix+12) ; ld h,(ix+13) ; ld a,(hl) ; and $80 ; ld (hl),a ; ld (ix),$01 ; ret ; BbM1 bit 1,(ix) ; ret z ; ld l,(ix+9) ; ld h,(ix+10) ; ld e,(ix+3) ; ld d,(ix+4) ; push de ; ret ; TM2 ld l,(ix+12) ; ld h,(ix+13) ; ld a,(hl) ; and $80 ; ld (hl),a ; TM2a dec (ix+22) ; jr z TM2to ; ld a,(ix+23) ; sub (ix+24) ; ld (ix+23),a ; jp p TM21 ; ld a,(ix+1) ; add a,(ix+20) ; ld l,a ; ld a,(ix+2) ; add a,(ix+21) ; ld h,a ; ld a,(ix+23) ; add a,(ix+25) ; ld (ix+23),a ; jp TM22 ; TM22a ld h,$14 ; jr TM22b ; TM21 ld a,(ix+1) ; add a,(ix+26) ; ld l,a ; ld a,(ix+2) ; add a,(ix+27) ; ld h,a ; TM22 ld a,h ; or a ; jr z TM22a ; cp $15 ; jr nz TM22b ; ld h,$01 ; TM22b ld b,h ; ld a,$C9 ; add a,h ; ld h,a ; ld a,(hl) ; and $7F ; cp $02 ; call z SpHit ; or a ; jr nz TM2to ; ld a,(hl) ; and $80 ; or (ix+18) ; ld (hl),a ; ld (ix+2),b ; ld (ix+1),l ; ld (ix+12),l ; ld (ix+13),h ; jp DSetRad ; TM2to push ix ; pop iy ; ld a,(SpY) ; ld h,a ; ld a,r ; and $0F ; sub $07 ; add a,h ; ld h,a ; ld a,(Sp0) ; ld l,a ; ld e,(ix+1) ; ld a,r ; and $0F ; sub $07 ; add a,l ; ld l,a ; ld d,(ix+2) ; call InitLine ; ld (ix+22),$28 ; ld l,(ix+12) ; ld h,(ix+13) ; ld a,(hl) ; and $80 ; or (ix+18) ; ld (hl),a ; jp DSetRad ; struct ; dlFlags ds 1 ; 0 = dead dlY ds 1 ; Y ds 1 ; ds 1 ; dlX4 ds 1 ; 4 X1 dlX5 ds 1 ; 5 X2 ds 1 ; dlpMove ds 2 ; 7+8 dlTime ds 1 ; 9 dlBMY ds 1 ; 10 ds 1 ; ds 1 ; ds 1 ; ds 1 ; ds 1 ; lLaser send ; ClLrs ld hl,LrTl ; ld de,LrTl+1 ; ld bc,#FF ; ld (hl),1 ; ldir ; ret ; MSp push ix ; push iy ; push hl ; push de ; push bc ; push af ; call RemoveFromBM ; ld a,(Killed) ; or a ; jp z Alive ; ; We're exploding... call DrawSceenWhileDead ; ; call ClDList ; call MoveProj ; call Ex ; call InterruptSoundDrv ; Handle making a noise JP Leave ; ; Drive everything Alive call MSp3 ; ld hl,(pRateTl) ; ld a,(hl) ; or a ; push hl ; call MSp1 ; pop hl ; ld a,(SRt) ; or a ; jr nz MShack1 ; ld a,(hl) ; or a ; push af ; call p DecRight ; pop af ; call m DecLeft ; call TryIncLeft ; call TryIncRight ; ld (pRateTl),hl ; MShack1 call PlInBM ; call Bumping ; call Ex ; call SpsAttr ; Draw the ship's attributes call RadLp ; ld a,(SmartF) ; or a ; call nz SBb ; call IntJP ; Leave pop af ; pop bc ; pop de ; pop hl ; pop iy ; pop ix ; ei ; reti ; SBb xor a ; ld (SmartF),A ; ld ix,ThingTable+1024 ; call nSBombs ; or a ; ret z ; ld de,tw ; ld b,20 ; SBl bit 0,(ix) ; jr nz SBe ; bit 1,(ix) ; jr z SBe ; call KIta ; SBe add ix,de ; djnz SBl ; call SBombsd ; ret ; MSp3 ld a,(LeftF) ; ld b,a ; ld a,(RightF) ; xor b ; ret z ; ld a,b ; ld (SpDirX),A ; ret ; MSp1 call m MShLeft ; call p MShRight ; call NewScreen ; call Slew ; call DrawScreen ; call ClDList ; call MoveProj ; ld a,(SpDirX) ; or a ; ld hl,SpShL ; jr nz MSp2 ; ld hl,SpShR ; MSp2 ld (cSpSh),hl ; call PlDList ; ld bc,(RadSp) ; call CRadSp ; or a ; sbc hl,bc ; call nz ShipChg ; call PlRest ; ret ; ShipChg ld a,(bc) ; xor $C0 ; ld (bc),a ; add hl,bc ; ld a,(hl) ; xor $C0 ; ld (hl),a ; ret ; CRadSp ld a,(SpY) ; ld l,a ; ld h,$00 ; add hl,hl ; ld de,ConRT ; add hl,de ; ld a,(hl) ; inc hl ; ld h,(hl) ; ld l,a ; ld de,16 ; add hl,de ; ld (RadSp),hl ; ret ; ; Update the radar when required RadLp ld a,(RadWld) ; dec a ; ld (RadWld),A ; ret nz ; ld a,2 ; ld (RadWld),A ; ; Take this opportunity to tidy up the screen ld a,RadarAttr ; In case we overlap ld ($5800+4*32-1),a ; ld a,TopLineAttr ; ld ($5800),a ; ld ix,ThingTable+1024 ; ld de,tw ; ld b,$14 ; RadLp1 bit 0,(ix) ; jr nz RadE ; ld hl,(ix+34) ; ld a,(ix+36) ; xor (hl) ; ld (hl),a ; call RadWeld ; xor (hl) ; ld (hl),a ; ld de,tw ; RadE add ix,de ; djnz RadLp1 ; ret ; Bumping ld h,MountH/256 ; ld a,(Sp0) ; ld l,a ; ld a,(SpY) ; dec a ; cp (hl) ; call nc Bumping1 ; call c Dropping ; inc l ; cp (hl) ; call nc Bumping1 ; call c Dropping ; ret ; Dropping push hl ; push af ; ld a,(nMenCarried) ; or a ; jr z DroppingX ; inc h ; bit 7,(hl) ; Space free? jr z DroppingX ; call FTTSMn ; jr c DroppingX ; call ManDrop ; ld a,(SpY) ; ld (hl),a ; ld a,(nMenCarried) ; dec a ; ld (nMenCarried),a ; ld (ix+0),0 ; ld (ix+1),l ; ld a,(SpY) ; ld (ix+2),a ; ld hl,ManSh ; ld (ix+3),l ; ld (ix+4),h ; ld (ix+5),1 ; ld (ix+6),66 ; ld hl,ManM ; ld (ix+7),l ; ld (ix+8),h ; ld (ix+#B),2 ; ld (ix+17),8 ; ld (ix+19),7 ; White ld a,(EntryNo) ; ld (ix+18),a ; DroppingX pop af ; pop hl ; ret ; Bumping1 push hl ; push af ; ld a,(SpY) ; ld b,a ; inc h ; ld a,(hl) ; and #7F ; cp b ; jr nz Bump1X ; ld (hl),#FF ; call FindManEnt ; call ManGrab ; set 0,(iy) ; bit 1,(iy) ; jr z Bum ; ld l,(iy+9) ; ld h,(iy+10) ; res 1,(iy) ; call ManSh ; Bum ld a,(iy+#B) ; cp 1 ; jr nz Bump1a ; ld l,(iy+#F) ; ld h,(iy+#10) ; push hl ; pop ix ; ld (ix+#B),0 ; Bump1a ld a,(nMenCarried) ; inc a ; ld (nMenCarried),a ; Bump1X pop af ; pop hl ; ret ; AddEx call mkExplSd ; call FindExSpace ; ret c ; ld d,(ix+1) ; ld e,(ix+2) ; res 2,(iy+0) ; ld bc,0 ; inc c ; call DWexpl1 ; inc b ; call DWexpl1 ; dec c ; call DWexpl1 ; dec c ; call DWexpl1 ; dec b ; call DWexpl1 ; dec b ; call DWexpl1 ; inc c ; call DWexpl1 ; inc c ; DWexpl1 res 0,(iy+0) ; ld (iy+3),c ; ld (iy+4),b ; ld (iy+1),e ; ld (iy+2),d ; ld (iy+7),0 ; ld (iy+5),1 ; ld (iy+8),6 ; ld (iy+9),2 ; ld (iy+10),1 ; push de ; ld de,16 ; add iy,de ; pop de ; ret ; ; Draw the explosion fragments Ex ld ix,ExTabl ; ld de,16 ; ld b,40 ; ExLoop call Exp ; add ix,de ; djnz ExLoop ; ret ; Exp bit 0,(ix+0) ; ret nz ; ld l,(ix+6) ; ld h,(ix+7) ; call ExSh1 ; dec (ix+5) ; jr nz Ex1 ; ld a,(ix+9) ; add a,(ix+10) ; ld (ix+9),a ; ld a,(ix+9) ; sra a ; ld (ix+5),a ; dec (ix+8) ; jr z ExEnd ; ld a,(ix+2) ; add a,(ix+4) ; ld (ix+2),a ; ld a,(ix+1) ; add a,(ix+3) ; ld (ix+1),a ; Ex1 push bc ; call ExCalcAdd ; pop bc ; ld de,16 ; ld (ix+6),l ; ld (ix+7),h ; call c ExSh1 ; ret ; ThingTab defw TSh0,TM0 ; defb 0,0,1,#44 ; defw TSh1,TM1 ; defb 0,0,2,#45 ; defw TSh2,TM2 ; defb 0,0,3,#45 ; defw TSh4,TM2 ; defb 1,0,4,#43 ; defw TSh0,TM0 ; defb 1,3,1,#46 ; defw ManSh,ManM ; defb 66,0,10,#07 ; Not here ! ExEnd set 0,(ix+0) ; bit 2,(ix+0) ; ret z ; push bc ; push de ; push ix ; pop iy ; ld a,(iy+11) ; cp 6 ; jp z ExEMan ; call FTTSTg ; jp c ExEnd1 ; ld a,(iy+11) ; dec a ; ld l,a ; ld h,0 ; add hl,hl ; add hl,hl ; add hl,hl ; ld de,ThingTab ; add hl,de ; ld a,(hl) ; inc hl ; ld (ix+3),a ; ld a,(hl) ; inc hl ; ld (ix+4),a ; ld a,(hl) ; inc hl ; ld (ix+7),a ; ld a,(hl) ; inc hl ; ld (ix+8),a ; ld b,(hl) ; inc hl ; ld (ix+6),b ; ld a,(hl) ; inc hl ; ld (ix+#B),a ; ld a,(hl) ; inc hl ; ld (ix+#11),a ; ld a,(hl) ; ld (ix+#13),a ; ld a,b ; or a ; jr nz ExHEnd1 ; ld a,r ; and #1F ; add a,14 ; ld (ix+6),a ; ExHEnd1 ld (ix+5),1 ; ld a,(iy+2) ; ld (ix+1),a ; ld b,(iy+1) ; ld (ix+2),b ; ld a,(EntryNo) ; ld (ix+18),a ; ld a,r ; and #1 ; ld (ix+#E),a ; ld (ix+0),0 ; ld (ix+10),0 ; ld l,(ix+2) ; Y ld a,(V0) ; ld b,a ; ld a,(ix+1) ; X sub b ; cp 32 ; jr nc ExEnd1 ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; add a,(hl) ; inc hl ; ld h,(hl) ; ld l,a ; ld e,(ix+3) ; ld d,(ix+4) ; call CallDE ; call ClRest ; ExEnd1 call SetRad ; ld l,(ix+1) ; ld a,(ix+2) ; add a,BigMaze/256 ; ld h,a ; ld a,(hl) ; and #7F ; jr nz ExEnd2 ; ld a,(hl) ; or (ix+18) ; ld (hl),a ; ld (ix+#C),l ; ld (ix+#D),h ; ExEnd2 push iy ; pop ix ; pop de ; pop bc ; ret ; ExCalcAdd ld a,(V0) ; ld b,a ; ld a,(ix+2) ; ld hl,0 ; sub b ; cp 32 ; ret nc ; push af ; ld a,(ix+1) ; or a ; jp m ExCA1 ; cp 21 ; ^ jr nc ExCA1 ; and #1F ; ld l,a ; pop af ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; add a,(hl) ; inc hl ; ld h,(hl) ; ld l,a ; scf ; ret ; ExCA1 pop af ; or a ; ret ; ExSh1 inc h ; inc h ; inc h ; ld a,#18 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#18 ; xor (hl) ; ld (hl),a ; ret ; ExEMan call CrMan ; push iy ; pop ix ; pop de ; pop bc ; ret ; Wm push de ; call GetMSpace ; pop de ; dec a ; jr Wu ; WarpItIn push de ; Find a space in the fragment table call FindExSpace ; pop de ; ret c ; Couldn't ld a,d ; cp 6 ; jr z Wm ; push de ; call GetTSpace ; Find a free space pop de ; Wu ld (iy+11),d ; set 2,(iy+0) ; add a,7 ; ld c,a ; ld de,#00FF ; call DWW ; inc d ; ld a,b ; sub 7 ; ld b,a ; call DWW ; inc e ; ld a,c ; sub 7 ; ld c,a ; call DWW ; inc e ; ld a,c ; sub 7 ; ld c,a ; call DWW ; dec d ; ld a,b ; add a,7 ; ld b,a ; call DWW ; dec d ; ld a,b ; add a,7 ; ld b,a ; call DWW ; dec e ; ld a,c ; add a,7 ; ld c,a ; call DWW ; dec e ; ld a,c ; add a,7 ; ld c,a ; ; Add a warping in blob DWW res 0,(iy+0) ; Add a warp fragment ld (iy+1),b ; ld (iy+2),c ; ld (iy+3),d ; ld (iy+4),e ; ld (iy+5),9 ; ld (iy+8),7 ; ld (iy+9),9 ; ld (iy+10),#FF ; ld (iy+7),0 ; push de ; ld de,16 ; add iy,de ; pop de ; ret ; InitEx ld ix,ExTabl ; ld b,40 ; ld de,16 ; InitExloop ld (ix+0),1 ; add ix,de ; djnz InitExloop ; ret ; ; Find a space in the explosion table -> IY FindExSpace ld hl,ExTabl+0 ; ld de,16 ; ld b,40 ; FESloop or a ; bit 0,(hl) ; jr nz FES_GotOne ; add hl,de ; djnz FESloop ; scf ; ret ; FES_GotOne ex de,hl ; ld iy,de ; ret ; DecRight or a ; ret z ; ld a,(RightF) ; or a ; ret nz ; dec hl ; ret ; DecLeft or a ; ret z ; ld a,(LeftF) ; or a ; ret nz ; inc hl ; ret ; TryIncLeft ld a,(LeftF) ; or a ; ret z ; xor a ; ld (LeftF),a ; dec hl ; ld a,(hl) ; cp #FF ; ret nz ; inc hl ; ret ; TryIncRight ld a,(RightF) ; or a ; ret z ; xor a ; ld (RightF),a ; inc hl ; ld a,(hl) ; cp #FF ; ret nz ; dec hl ; ret ; NewScreen ld hl,(pRateTl) ; ld a,(hl) ; or a ; ret z ; ld a,(nDir) ; or a ; call nz StepNPLeft ; jp z StepNPRight ; ret ; Slew ld a,(SpDirX) ; or a ; ld c,4 ; jr z SlewL ; ld c,27 ; SlewL ld a,(nV0) ; ld b,a ; ld a,(nSp0) ; sub b ; cp c ; Slew1 ret z ; call c StepNPLeft ; jp nc StepNPRight ; ret ; DrawScreen call DWupdown ; call FireIfNess ; DrawSceenWhileDead ld ix,(pNewPos) ; ld iy,(pOldPos) ; ld de,0 ; ; Draw the mountains NSloop ld hl,(iy) ; add hl,de ; ld bc,(iy+2) ; call CallBC ; ld hl,(ix) ; add hl,de ; ld bc,(ix+2) ; call CallBC ; ld hl,(ix+4) ; add hl,de ; ld (hl),$43 ; Mountain attribute ld bc,8 ; add ix,bc ; add iy,bc ; inc e ; de = screen X ld a,e ; cp 32 ; jp nz NSloop ; ld hl,(pNewPos) ; ld (pOldPos),hl ; ; Draw the lasers ld ix,LrTl ; ld de,16 ; ld b,nLasers ; DWLloop bit 0,(ix+dlFlags) ; call z DWLdoit ; add ix,de ; djnz DWLloop ; ret ; DWLdoit push de ; push bc ; ld a,(V0) ; call DrawLr ; dec (ix+dlTime) ; jr nz DWLdoit1 ; ld (ix+dlTime),1 ; ld hl,(ix+dlpMove) ; Move it? call CallHL ; DWLdoit1 bit 0,(ix+dlFlags) ; ld a,(nV0) ; call z DrawLr ; pop bc ; pop de ; ret ; DrawLr ld b,a ; ld l,(ix+2) ; ld h,(ix+3) ; ld a,(ix+4) ; ld c,a ; sub (ix+5) ; ret z ; neg ; ld e,a ; ld a,c ; sub b ; jp m DrawLr1 ; cp 32 ; ret nc ; ld c,a ; add a,e ; cp 32 ; jr c DrawLr2 ; ld a,32 ; DrawLr2 sub c ; ld b,a ; ld a,c ; add a,l ; ld l,a ; DrawLr3a ld c,b ; ld e,l ; DrawLr3 ld a,(hl) ; xor l ; xor h ; xor b ; ld (hl),a ; inc l ; djnz DrawLr3 ; ld l,(ix+1) ; Draw the attribute ld h,0 ; add hl,hl ; add hl,hl ; add hl,hl ; add hl,hl ; add hl,hl ; ld a,e ; ld de,#5B00 ; and #1F ; ex de,hl ; sbc hl,de ; ld e,a ; ld d,0 ; add hl,de ; ld b,c ; ld a,r ; and $07 ; jr nz CalcColour1 ; inc a ; CalcColour1 or $40 ; DrawLA ld (hl),a ; Laser attribute inc l ; djnz DrawLA ; ret ; DrawLr1 add a,e ; ret m ; ret z ; ld b,a ; cp 32 ; jr c DrawLr3a ; ld b,32 ; jr DrawLr3a ; IncLrR ld a,(ix+4) ; ld b,(ix+5) ; inc a ; inc b ; call HitTB ; inc b ; call HitTB ; ld (ix+4),a ; ld (ix+5),b ; sub b ; neg ; cp 16 ; ret c ; ld hl,DecLrR ; ld (ix+dlpMove),hl ; ret ; HitTA ld h,(ix+dlBMY) ; ld l,a ; ld a,(hl) ; and #7F ; ld a,l ; ret z ; Nothing call KIt ; ld a,l ; ret ; DecLrR ld a,(ix+4) ; ld b,(ix+5) ; inc a ; call HitTA ; inc a ; inc a ; call HitTA ; inc b ; ld (ix+4),a ; ld (ix+5),b ; sub b ; ret nz ; set 0,(ix+dlFlags) ; Kill it ret ; HitTB ld h,(ix+dlBMY) ; Check if we've hit anything (b=x) ld l,b ; ld c,a ; ld a,(hl) ; and #7F ; ld a,c ; ret z ; call KIt ; ld a,c ; ret ; KIta push hl ; push de ; push bc ; push af ; push ix ; ld l,(ix+12) ; ld h,(ix+13) ; ld (hl),0 ; jr KItb ; KIt push hl ; push de ; push bc ; push af ; push ix ; ld a,(hl) ; Remove it from Big Maze ld b,a ; and #80 ; ld (hl),a ; ld a,b ; Now get its IX ld h,pTgT/256 ; and #7F ; ld l,a ; ld e,(hl) ; inc h ; ld d,(hl) ; ld a,e ; Not a valid thing... or d ; jr z KItE ; push de ; pop ix ; KItb bit 0,(ix) ; If it's dead already we ignore it... jr nz KItE ; ld a,(ix+17) ; cp 10 ; jr z KItE1 ; cp 3 ; jp z KIpod ; set 0,(ix) ; ld l,(ix+34) ; ld h,(ix+35) ; ld a,(ix+36) ; xor (hl) ; ld (hl),a ; ld a,(ix+1) ; ld l,(ix+2) ; call AddEx ; Explode a thing? ld a,(ix+17) ; ld de,1 ; cp 1 ; jr nz ScorD ; ld a,(ix+11) ; cp 3 ; jr nz ScorC ; ld de,5 ; ScorC call AddScore ; bit 1,(ix) ; res 1,(ix) ; jr z KIt1 ; ld l,(ix+9) ; ld h,(ix+10) ; ld e,(ix+3) ; ld d,(ix+4) ; call CallDE ; KIt1 ld a,(ix+#B) ; or a ; jr z KItE ; cp $03 ; jr c KItCMFSD ; KItE pop ix ; pop af ; pop bc ; pop de ; pop hl ; ret ; ScorD cp 4 ; jr c ScorC ; ld de,3 ; jr ScorC ; KItE1 ld l,(ix+#C) ; ld h,(ix+#D) ; ld a,(ix+18) ; or (hl) ; ld (hl),a ; jr KItE ; KItCMFSD ld l,(ix+#F) ; ld h,(ix+#10) ; push hl ; pop iy ; ld (iy+#B),3 ; ld (iy+5),24 ; ld (iy+6),24 ; ld l,(iy+1) ; ld h,$E2 ; ld a,(iy+2) ; ld (hl),a ; jr KItE ; KIpod bit 1,(ix) ; ld (ix),0 ; ld (ix+5),1 ; ld (ix+6),2 ; jr z KIpoda ; ld l,(ix+9) ; ld h,(ix+10) ; call TSh2 ; KIpoda ld (ix+17),7 ; ld (ix+3),TSh3&#FF ; ld (ix+4),TSh3/256 ; ld (ix+19),#45 ; Bright cyan? ld l,(ix+34) ; ld h,(ix+35) ; ld a,(ix+36) ; xor (hl) ; ld (hl),a ; ld (ix+35),0 ; push ix ; pop iy ; ld b,5 ; KIPl push bc ; call FTTSTg ; jr c KIPx ; push iy ; pop hl ; push ix ; pop de ; ld bc,tw ; ldir ; ld a,(EntryNo) ; ld (ix+18),a ; pop bc ; djnz KIPl ; jp KItE ; KIPx pop bc ; jp KItE ; IncLrL ld a,(ix+dlX4) ; ld b,(ix+dlX5) ; dec a ; call HitTA ; dec a ; call HitTA ; dec b ; ld (ix+dlX4),a ; ld (ix+dlX5),b ; sub b ; neg ; cp 16 ; ret c ; ld hl,DecLrL ; ld (ix+dlpMove),hl ; ret ; DecLrL ld a,(ix+dlX4) ; ld b,(ix+dlX5) ; dec a ; dec b ; call HitTB ; dec b ; call HitTB ; ld (ix+dlX4),a ; ld (ix+dlX5),b ; sub b ; End reached start? ret nz ; No set 0,(ix+dlFlags) ; Kill it ret ; ; Find a free laser space FindLrSp ld ix,LrTl ; ld de,lLaser ; ld b,nLasers ; or a ; FLSloop bit 0,(ix) ; ret nz ; add ix,de ; djnz FLSloop ; scf ; ret ; FireIfNess ld a,(FireF) ; or a ; ret z ; call mkLaserSd ; xor a ; ld (FireF),a ; call FindLrSp ; ld a,(SpDirX) ; or a ; ld a,(Sp0) ; Skip to the right if pointing right jr z FIN1 ; inc a ; FIN2 ld (ix+dlX4),a ; Set the X of the start and end ld (ix+dlX5),a ; ld a,(SpY) ; ld (ix+dlY),a ; ld l,a ; add a,BigMaze/256 ; ld (ix+dlBMY),a ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; ld a,(hl) ; ld (ix+2),a ; inc hl ; ld a,(hl) ; add a,5 ; ld (ix+3),a ; call WhichM ; ld (ix+dlpMove),hl ; ld (ix+dlFlags),0 ; Alive ld (ix+9),1 ; Length? ret ; FIN1 inc a ; jr FIN2 ; ; Get the laser move routine WhichM ld hl,IncLrR ; ld a,(SpDirX) ; or a ; ret z ; ld hl,IncLrL ; ret ; PutTT ld a,(hl) ; cpl ; ld (hl),a ; ret ; PutBT ld a,1 ; xor (hl) ; ld (hl),a ; inc h ; ld a,2 ; xor (hl) ; ld (hl),a ; inc h ; ld a,4 ; xor (hl) ; ld (hl),a ; inc h ; ld a,8 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#10 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#20 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#40 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#80 ; xor (hl) ; ld (hl),a ; ret ; PutMB set 2,h ; PutTM ld a,#C0 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#30 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#0C ; xor (hl) ; ld (hl),a ; inc h ; ld a,#03 ; xor (hl) ; ld (hl),a ; ret ; PutMM inc h ; inc h ; inc h ; ld a,(hl) ; cpl ; ld (hl),a ; ret ; PutBM set 2,h ; PutMT ld a,#03 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#0C ; xor (hl) ; ld (hl),a ; inc h ; ld a,#30 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#C0 ; xor (hl) ; ld (hl),a ; inc h ; ret ; PutTB ld a,#80 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#40 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#20 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#10 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#08 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#04 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#02 ; xor (hl) ; ld (hl),a ; inc h ; ld a,#01 ; xor (hl) ; ld (hl),a ; ret ; PutBB ld a,h ; add a,7 ; ld h,a ; ld a,(hl) ; cpl ; ld (hl),a ; ret ; DWupdown ld a,(UpF) ; ld b,a ; ld a,(DownF) ; xor b ; jr z DWudexit ; ld a,b ; or a ; push af ; call nz MSpUp ; pop af ; call z MSpDown ; DWudexit xor a ; ld (UpF),a ; ld (DownF),a ; ret ; MSpUp ld a,(nInts) ; bit 0,a ; ret z ; ld a,(SpY) ; inc a ; cp 21 ; ^ ret z ; ld (nSpY),a ; ret ; MSpDown ld a,(nInts) ; bit 0,a ; ret z ; ld a,(SpY) ; dec a ; or a ; ret z ; ld (nSpY),a ; ret ; CrTl call ClBigMaze ; ld ix,OldDTl ; ld iy,DTl ; ld bc,#100 ; ld de,0 ; ld hl,MountH ; CTloop push hl ; push bc ; push de ; call CTEntry ; pop de ; push de ; call BMEntry ; pop de ; ld bc,8 ; add iy,bc ; inc ix ; inc ix ; inc de ; pop bc ; pop hl ; ld a,(ix-2) ; ld (hl),a ; inc h ; or #80 ; ld (hl),a ; dec h ; cpi ; jp v CTloop ; ld hl,DTl ; ld de,EndDTl ; ld bc,400 ; ldir ; ld hl,EndDTl-400 ; ld de,DTl-400 ; ld bc,200 ; ldir ; ret ; BMEntry ld b,(ix) ; inc b ; ld hl,BigMaze ; add hl,de ; ld de,#100 ; BMEloop set 7,(hl) ; add hl,de ; djnz BMEloop ; ret ; CTEntry ld l,(ix) ; ld h,0 ; add hl,hl ; ld de,ConYT ; add hl,de ; ld a,(hl) ; ld (iy),a ; inc hl ; ld a,(hl) ; ld (iy+1),a ; ld a,(ix+1) ; sub #80 ; ld l,a ; ld h,0 ; add hl,hl ; ld de,AddressT ; add hl,de ; ld a,(hl) ; ld (iy+2),a ; inc hl ; ld a,(hl) ; ld (iy+3),a ; ld l,(ix) ; ld h,0 ; add hl,hl ; add hl,hl ; add hl,hl ; add hl,hl ; add hl,hl ; ld de,#5B00 ; or a ; ex de,hl ; sbc hl,de ; ld (iy+4),l ; ld (iy+5),h ; ld (iy+6),7 ; ret ; DefInts ld hl,IntTab ; ld de,IntTab+1 ; ld bc,#100 ; ld (hl),#80 ; ldir ; ld a,IntTab/256 ; ld i,a ; ret ; CLS ld hl,#4000 ; ld de,#4001 ; ld bc,#1800 ; ld (hl),0 ; ldir ; ld (hl),TopLineAttr ; ld bc,32 ; ldir ; ld (hl),RadarAttr ; ld bc,96 ; ldir ; ld (hl),#07 ; ld bc,#2FF-128 ; ldir ; ld hl,#4220 ; ld de,#4221 ; ld bc,#1F ; ld (hl),#AA ; ldir ; ld hl,#4760 ; ld de,#4761 ; ld bc,#1F ; ld (hl),#AA ; ldir ; ld a,0 ; out (#FE),a ; ret ; OldDTl defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#82,#03,#80,#03,#80,#03,#86; defb #02,#80,#02,#80,#02,#83,#02,#81; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#82,#04,#82,#05,#82,#05,#86; defb #04,#86,#03,#86,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#82,#04,#85,#04,#81,#05,#82; defb #06,#82,#06,#80,#06,#80,#06,#83; defb #06,#84,#06,#84,#06,#87,#05,#86; defb #04,#80,#04,#80,#04,#83,#04,#84; defb #04,#84,#04,#87,#03,#83,#03,#87; defb #02,#83,#02,#84,#02,#84,#02,#84; defb #02,#81,#02,#80,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#82,#04,#82,#05,#82,#06,#82; defb #07,#82,#07,#80,#07,#86,#06,#86; defb #05,#86,#04,#86,#03,#86,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#82,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#04,#82,#04,#80; defb #04,#80,#04,#80,#04,#80,#04,#80; defb #04,#80,#04,#80,#04,#80,#04,#80; defb #04,#80,#04,#80,#04,#80,#04,#80; defb #05,#82,#05,#80,#05,#80,#05,#80; defb #05,#80,#05,#80,#05,#86,#04,#86; defb #03,#86,#02,#80,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#82,#03,#86,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#82,#04,#82,#05,#82,#06,#82; defb #07,#82,#08,#82,#09,#82,#09,#86; defb #08,#86,#07,#86,#06,#86,#05,#86; defb #04,#86,#03,#86,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#85,#03,#81,#03,#80,#03,#80; defb #03,#86,#02,#80,#02,#80,#02,#80; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #03,#85,#03,#84,#03,#84,#03,#81; defb #03,#80,#03,#83,#03,#84,#03,#87; defb #02,#80,#02,#80,#02,#80,#02,#80; defb #02,#83,#02,#87,#02,#82,#02,#80; defb #02,#80,#03,#85,#03,#81,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#04,#82,#05,#82,#05,#86; defb #04,#86,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #04,#85,#04,#84,#04,#81,#04,#80; defb #04,#80,#04,#80,#04,#83,#04,#84; defb #04,#84,#04,#87,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#80; defb #03,#80,#03,#80,#03,#80,#03,#83; defb #03,#84,#03,#84,#03,#87,#02,#80; Predef defw DTl ; defw DTl ; defb 0,0,0 ; defb 0,0 ; defb 0 ; defb 0 ; defb 0 ; defb 0 ; defb 0 ; defb 0 ; defb 0 ; defb 68 ; defb 0 ; defb 1 ; defb 0 ; defb 0 ; defb 16 ; defb 17 ; defb 17 ; defb 16 ; defb 16 ; defb 0 ; defb 0 ; defw SpShR ; defw 0 ; defb 0 ; defb 0 ; defb 0 ; defw 0 ; defb 0 ; defb 0 ; defb 0 ; defb 0 ; defb 0 ; defw 0 ; defb 1 ; defb 0 ; defb 0 ; defb 0 ; defw RateTl ; PredefE defs 40 ; RateTl defb 0 ; defb 3,2,2,2,1,2,1,1,2,1,1,1,2 ; defb 1,1,1,1,2,1,1,1,1,1,1,1,1 ; defb 1,1,1,1,1,1,1,1,1,1,#FF ; ConRT defw #4760,#4660,#4560,#4460 ; defw #4360,#4260,#4160,#4060 ; defw #4740,#4640,#4540,#4440 ; defw #4340,#4240,#4140,#4040 ; defw #4720,#4620,#4520,#4420 ; defw #4320,#4220,#4120,#4020 ; ConYT defw 0,#50E0,#50C0,#50A0,#5080 ; defw #5060,#5040,#5020,#5000 ; defw #48E0,#48C0,#48A0,#4880 ; defw #4860,#4840,#4820,#4800 ; defw #40E0,#40C0,#40A0,#4080 ; defw #4060,#4040,#4020,#4000,0 ; SpShR defb 0,#C0,#E0,#7F,#FF,#30, 0, 0; defb 0, 0, 0,#E0,#FF,#C0, 0, 0 ; SpShL defb 0, 0, 0, 7,#FF, 3, 0, 0 ; defb 0, 3, 7,#FE,#FF,#0C, 0, 0 ; align 256 ; Garb defb #C0,#30,#C,#3 ; ConYT2 defw 0,#50E0,#50C0,#50A0,#5080 ; defw #5060,#5040,#5020,#5000 ; defw #48E0,#48C0,#48A0,#4880 ; defw #4860,#4840,#4820,#4800 ; defw #40E0,#40C0,#40A0,#4080 ; defw #4060,#4040,#4020,#4000 ; LineYs defw #4000,#4020,#4040,#4060 ; defw #4080,#40A0,#40C0,#40E0 ; defw #4800,#4820,#4840,#4860 ; defw #4880,#48A0,#48C0,#48E0 ; defw #5000,#5020,#5040,#5060 ; defw #5080,#50A0,#50C0,#50E0 ; ; This space is used as the input buffer for high-score entry and some other things. GetIB ds 110 ; GetIL defw 0 ; align 256 ; ; This is where the loader calls us, call this to styart the game org $9E00 ; EntryPt di ; ld sp,0 ; jr Begin0 ; CallHL2 jp (hl) ; CallDE2 push de ; Ret2 ret ; CallBC2 push bc ; ret ; Begin0 call CLS2 ; ld ix,LineYs ; ld hl,MessJK ; ld b,19 ; call PrintMess ; xor a ; ld (FullerConn),a ; call TurnOffSd ; ; Wait for a Y or an N Begin0b ld bc,57342 ; in a,(c) ; bit 4,a ; jr z BeginFB ; ld bc,32766 ; in a,(c) ; bit 3,a ; jp z Begin0Ex ; jr Begin0b ; BeginFB ld a,1 ; ld (FullerConn),a ; call TurnOnSd ; jp Begin0Ex ; PrintMess push ix ; push bc ; push hl ; ld e,(ix) ; ld d,(ix+1) ; ld (CurY),de ; xor a ; ld (CurX),a ; call DWMess ; pop hl ; pop bc ; pop ix ; inc ix ; inc ix ; call SkipTZ ; djnz PrintMess ; ret ; KL ld bc,65278 ; in a,(c) ; bit 1,a ; ret z ; ld bc,63486 ; in a,(c) ; bit 4,a ; ret ; KR ld bc,65278 ; in a,(c) ; bit 2,a ; ret z ; ld bc,61438 ; in a,(c) ; bit 2,a ; ret ; KU ld bc,32766 ; in a,(c) ; bit 3,a ; ret z ; ld bc,61438 ; in a,(c) ; bit 3,a ; ret ; KD ld bc,32766 ; in a,(c) ; bit 2,a ; ret z ; ld bc,61438 ; in a,(c) ; bit 4,a ; ret ; KS ld bc,49150 ; in a,(c) ; or #E0 ; inc a ; jr z KS1 ; xor a ; ret ; KS1 inc a ; ret ; KF ld bc,61438 ; in a,(c) ; bit 0,a ; ret z ; ld bc,65022 ; in a,(c) ; or #E0 ; inc a ; jr z KF1 ; xor a ; ret ; KF1 inc a ; ret ; JL in a,(31) ; cpl ; bit 1,a ; ret ; Jr in a,(31) ; cpl ; bit 0,a ; ret ; JU in a,(31) ; cpl ; bit 3,a ; ret ; JD in a,(31) ; cpl ; bit 2,a ; ret ; JF in a,(31) ; cpl ; bit 4,a ; ret ; JS ld bc,#00FE ; in a,(c) ; or #E0 ; inc a ; jr z JS1 ; xor a ; ret ; JS1 inc a ; ret ; FL in a,(127) ; bit 2,a ; ret ; FR in a,(127) ; bit 3,a ; ret ; FU in a,(127) ; bit 0,a ; ret ; FD in a,(127) ; bit 1,a ; ret ; FF in a,(127) ; bit 7,a ; ret ; FS ld bc,#00FE ; in a,(c) ; or #E0 ; inc a ; jr z FS1 ; xor a ; ret ; FS1 inc a ; ret ; KinVec jp KL ; jp KR ; jp KU ; jp KD ; jp KS ; jp KF ; JinVec jp JL ; jp Jr ; jp JU ; jp JD ; jp JS ; jp JF ; FinVec jp FL ; jp FR ; jp FU ; jp FD ; jp FS ; jp FF ; SetUpKbd ld hl,KinVec ; jr SU42 ; SetUpJsk ld hl,JinVec ; jr SU42 ; SetUpFul ld hl,FinVec ; SU42 ld de,IOptrs ; ld bc,18 ; ldir ; ret ; TurnOffSd ld a,#C9 ; RET instruction TOSd1 ld (InitSound),a ; ld (InterruptSoundDrv),a ; ld (KillSd),a ; ld (mkExplSd),a ; ld (mkProjSd),a ; ld (ShipExplSd),a ; ret ; TurnOnSd xor a ; NOP instruction jr TOSd1 ; Begin0Ex ld hl,0 ; ld (Score),hl ; Begin call HighDisp ; ld a,1 ; ld (nFrames),a ; ld a,3 ; ld (nShips),a ; ld (nSmarts),a ; ld a,12 ; ld (nMen),a ; ld iy,StartSh ; ld hl,$0 ; ld (Score),hl ; ld hl,1 ; ld (ManVal),hl ; call Game ; GameExit di ; ld sp,0 ; call KillSd ; call Report ; jr Begin ; HighDisp call CLS2 ; ld ix,LineYs ; ld hl,Mess6 ; ld b,4 ; call PrintMess ; xor a ; ld (HSDoneIt),a ; ld hl,HighScores ; ld a,1 ; ld (CurX),a ; ld a,'1' ; HighLoop push af ; push hl ; push ix ; ld e,(ix) ; ld d,(ix+1) ; ld (CurY),de ; push ix ; push hl ; call OutChar ; pop hl ; pop ix ; call LeaveLine ; jp c HighL1 ; ld a,10 ; ld (CurX),a ; call DWMess ; ld a,0 ; ld (CurX),a ; pop ix ; pop hl ; pop af ; call SkipTZ ; ld e,(hl) ; inc hl ; ld d,(hl) ; inc hl ; push hl ; push af ; ld l,(ix) ; ld h,(ix+1) ; ld bc,27 ; add hl,bc ; push ix ; call DispNo ; pop ix ; pop af ; pop hl ; HighL2 inc ix ; inc ix ; inc a ; cp "9"+1 ; jr nz HL1 ; ld a,'A' ; HL1 cp 'H' ; jr nz HighLoop ; inc hl ; inc hl ; ld (HSptr2),hl ; ld a,(HSDoneIt) ; or a ; jr z HL2 ; ld hl,(HSy) ; ld (CurY),hl ; ld a,10 ; ld (CurX),a ; call GetInput ; call InsertEnt ; ld hl,0 ; ld (Score),hl ; call HighDisp ; ret ; HL2 ld hl,pySPC ; ld (CurY),hl ; ld a,pxSPC ; ld (CurX),a ; ld hl,MessSPC ; call DWMess ; HL3 ld bc,49150 ; in a,(c) ; bit 3,a ; jr z HL3Joy ; J bit 2,a ; jr z HL3Key ; K ld bc,32766 ; in a,(c) ; bit 0,a ; jr nz HL3 ; ret ; HL3Joy jp SetUpJsk ; HL3Key jp SetUpKbd ; WaitTS ld bc,32766 ; in a,(c) ; bit 0,a ; ret z ; jr WaitTS ; InsertEnt ld bc,(GetIL) ; inc bc ; inc bc ; inc bc ; ld hl,(HSptr2) ; add hl,bc ; ex de,hl ; ld hl,(HSptr2) ; push hl ; push de ; ld hl,(HSptr2) ; ld de,(HSptr1) ; or a ; sbc hl,de ; ld b,h ; ld c,l ; inc bc ; pop de ; pop hl ; lddr ; ld hl,GetIB ; ld de,(HSptr1) ; ld bc,(GetIL) ; ldir ; ex de,hl ; ld (hl),0 ; inc hl ; ld de,(Score) ; ld (hl),e ; inc hl ; ld (hl),d ; ret ; GetInput call InitInt ; ld hl,GetIB ; GetIl push hl ; ld c,1 ; ld b,CurSpeed ; call PutCursor ; InLin2 djnz InLin3 ; ld a,c ; xor 1 ; ld c,a ; call PutCursor ; ld b,CurSpeed ; InLin3 push bc ; push hl ; halt ; pop hl ; pop bc ; or a ; jr z,InLin2 ; bit 0,c ; jr z,InLin4 ; call PutCursor ; InLin4 pop hl ; cp 8 ; jp z DelChar ; cp #D ; jr z GetIEx ; push hl ; push af ; call OutChar ; pop af ; pop hl ; ld (hl),a ; inc hl ; ld a,(CurX) ; cp 214 ; jp nc DelChar ; jr GetIl ; GetIEx ld (hl),0 ; ld de,GetIB ; or a ; sbc hl,de ; jp z SetToSomeone ; ld a,l ; cp $64 ; jp nc SetToWrists ; ld (GetIL),hl ; call KillInt ; ld ix,MatchedStrs ; ld iy,CompStrs ; GIE1 call FindMatch ; jr z ReplaceEntry ; call SkipToEndIX ; call SkipToEndIY ; ld a,(ix) ; cp $FF ; ret z ; jr GIE1 ; SkipToEndIX ld a,(ix) ; inc ix ; or a ; jr nz SkipToEndIX ; ret ; SkipToEndIY ld a,(iy) ; inc iy ; or a ; jr nz SkipToEndIY ; ret ; ld a,(hl) ; cp $20 ; ret nz ; inc hl ; FindMatch push ix ; ld hl,GetIB ; FindMatchLp ld a,(hl) ; inc hl ; cp $20 ; jr z FindMatchLp ; or a ; jr z FindMatchEnd ; call bIsSomeRange ; cp (ix) ; inc ix ; jr z FindMatchLp ; dec ix ; FindMatchEnd ld a,(ix) ; or a ; pop ix ; ret ; bIsSomeRange cp $5B ; ret nc ; cp $41 ; ret c ; add a,$20 ; ret ; ReplaceEntry push iy ; pop hl ; jr StrCopy ; sWrists db "Bet yer wrists hurt after that !",0 ; sSomeone db "Someone",0 ; SetToSomeone call KillInt ; ld hl,sSomeone ; jr StrCopy ; SetToWrists call KillInt ; ld hl,sWrists ; StrCopy ld de,GetIB ; ld bc,$0000 ; StrCopyLp ld a,(hl) ; ld (de),a ; or a ; ld (GetIL),bc ; ret z ; inc bc ; inc de ; inc hl ; jr StrCopyLp ; ; The replacement strings for the matches below CompStrs db "A.Machin",0 ; Andrew Machin, a friend. Author of LERM db "The Thing",0 ; db "N.Pottingshed",0 ; Neil, of course. db "K.R.D.Terry",0 ; A friend from school db "A.Walker",0 ; My oldest friend db "R.Walker",0 ; His sister, who I lusted after. Now sadly gone :( db "J.Lawrence",0 ; Another old school friend db "Hello Maria !",0 ; Martin's girlfriend db "Programmers in general eh ?",0; And something she said db "Smart arse",0 ; Martin Horsley db "42 of course !",0 ; HHGTTG, of course db "The cardboard box !",0 ; A friend... ish... and an old Jasper Carrot joke db "P.J.Finnegan",0 ; A great character from "The World of Tiers" SF series. db "Greens Original",0 ; db "Crappy processor",0 ; db "Hi Jim !",0 ; My flatmate at the time db "Chrisipoos",0 ; db "Life don't ....",0 ; db "Boring tit !",0 ; db "Wrong game !",0 ; References to a text game db "Bells ring etc .",0 ; References to a text game? db "Yes please !",0 ; db "Like too !",0 ; db "Cheese ?",0 ; Don't ask. An earlier version of this used "cheese" as a joke db "She's moved to 061-205-6603",0; One of the women in the flat above us, and the old company number db "Chmee",0 ; Ringworld reference db "Ghastly rubber thing",0 ; I always hated the spectrum. db "Design Design Software",0 ; db "Halls",0 ; db "A blaze of trumpets & singing angels",0; From the first ever review of Halls by Tony Hall db "It's easier with three arms I suppose",0; HHGTTG, of course db TIMESTR,0 ; ; The strings we are looking for MatchedStrs db "andym",0 ; db "chewrubba",0 ; db "motty",0 ; db "krdt",0 ; db "alanw",0 ; db "rozzer",0 ; db "johnl",0 ; db "meb",0 ; db "maria",0 ; db "mash",0 ; db "whatisthe",0 ; db "dave",0 ; db "kickaha",0 ; db "cheesecake",0 ; db "6502",0 ; db "jdg",0 ; db "c.c.c.",0 ; db "marvin",0 ; db "darthvader",0 ; db "xyzzy",0 ; db "blach",0 ; db "sex",0 ; db "fuck",0 ; db "cheese",0 ; db "lavinia",0 ; db "speakertoanimals",0 ; db "spectrum",0 ; db "crystal",0 ; db "hott",0 ; db "tony",0 ; db "zaphod",0 ; db "version",0 ; db $FF ; PutCursor push af ; ld a,(CurX) ; push af ; ld a,'_' ; push bc ; push de ; push hl ; push ix ; call OutChar ; pop ix ; pop hl ; pop de ; pop bc ; pop af ; ld (CurX),a ; pop af ; ret ; DelChar ex de,hl ; ld hl,GetIB ; or a ; sbc hl,de ; ex de,hl ; jp z GetIl ; dec hl ; ld a,(hl) ; push hl ; ld l,a ; ld h,0 ; ld de,#7F00 ; add hl,de ; ld b,(hl) ; ex af,af' ; ld a,(CurX) ; sub b ; ld (CurX),a ; ex af,af' ; call OutChar ; ex af,af' ; ld (CurX),a ; pop hl ; jp GetIl ; HighL1 pop ix ; ld l,(ix) ; ld h,(ix+1) ; ld bc,27 ; add hl,bc ; ld de,(Score) ; push ix ; call DispNo ; pop ix ; ld a,0 ; ld (CurX),a ; pop hl ; pop af ; jp HighL2 ; Report call CLS2 ; ld hl,pyREP ; ld (CurY),hl ; ld a,pxREP ; ld (CurX),a ; ld hl,MessRep ; call DWMess ; ld hl,(Score) ; call PrintDec ; call Delay ; ret ; InitInt ld hl,IntPage ; ld de,IntPage+1 ; ld bc,$100 ; ld (hl),IntVecByte ; ldir ; ld hl,(IntVec) ; ld (BasicI),hl ; ld hl,Interrupt1 ; ld (IntVec),hl ; di ; im 2 ; ld a,i ; ld (BasicI),a ; ld a,high IntPage ; ld i,a ; ei ; halt ; Sync to first Int ei ; reti ; KillInt di ; ld hl,SInt ; ld (IntVec),hl ; ret ; KeyScan ld hl,kMap ; ld a,(hl) ; rlca ; ld (hl),a ; in a,(#FE) ; or #E0 ; ld c,a ; inc hl ; ld a,(hl) ; ld d,0 ; inc a ; and 7 ; ld (hl),a ; ld e,a ; inc e ; add hl,de ; ld a,#FE ; in a,(#FE) ; ld d,a ; ld a,#7F ; in a,(#FE) ; rrca ; rrca ; rl d ; ld e,c ; KeyS0 ld a,e ; xor (hl) ; ret z ; ld c,a ; xor a ; ld b,#FF ; scf ; KeyS1 rla ; inc b ; rrc c ; jr nc,KeyS1 ; ld c,a ; xor (hl) ; ld (hl),a ; ld a,e ; and c ; jr nz,KeyS0 ; ld a,(kMap+1) ; ld c,a ; add a,a ; add a,a ; add a,c ; add a,b ; ld c,a ; ld b,0 ; ld hl,kTab ; add hl,bc ; ld bc,40 ; rr d ; jr c,KeyS2 ; add hl,bc ; KeyS2 rr d ; jr c,KeyS3 ; add hl,bc ; add hl,bc ; KeyS3 ld a,(hl) ; ret ; Interrupt1 push bc ; ld b,ScanRate ; IntLL2 push bc ; call KeyScan ; or a ; pop bc ; jr nz,IntFin ; djnz IntLL2 ; IntFin pop bc ; ei ; reti ; BasicI defw 0 ; kMap defb #7F,7 ; defb #FF,#FF,#FF,#FF ; defb #FF,#FF,#FF,#FF ; kTab defb #00, "Z", "X", "C", "V" ; defb "A", "S", "D", "F", "G" ; defb "Q", "W", "E", "R", "T" ; defb "1", "2", "3", "4", "5" ; defb "0", "9", "8", "7", "6" ; defb "P", "O", "I", "U", "Y" ; defb #0D, "L", "K", "J", "H" ; defb #20,#00, "M", "N", "B" ; defb #00, ":", "`", "?", "/" ; defb #00,#00,#00,#00,#00 ; defb #00,#00,#00, "<", ">" ; defb "!", "@", "#", "$", "%" ; defb "_", ")", "(", "'", "&" ; defb #22, ";",#00,#00,#00 ; defb #00, "=", "+", "-", "^" ; defb #00,#00, ".", ",", "*" ; defb #00, "z", "x", "c", "v" ; defb "a", "s", "d", "f", "g" ; defb "q", "w", "e", "r", "t" ; defb "1", "2", "3", "4", "5" ; defb #08, "9", "8", "7", "6" ; defb "p", "o", "i", "u", "y" ; defb #00, "l", "k", "j", "h" ; defb #20,#00, "m", "n", "b" ; defb #00, "Z", "X", "C", "V" ; defb "A", "S", "D", "F", "G" ; defb "Q", "W", "E", "R", "T" ; defb "1", "2", "3", "4", "5" ; defb "0", "9", "8", "7", "6" ; defb "P","O","I","U","Y" ; defb #0D, "L", "K", "J", "H" ; defb #00,#00, "M", "N", "B" ; Rand call Rand1 ; ld de,(Seed) ; ret ; Rand1 ld hl,(Seed+2) ; rl l ; rl h ; rl l ; rl h ; ld c,h ; ld a,(Seed) ; rla ; ld b,a ; ld de,(Seed+1) ; rl e ; rl d ; res 7,d ; ld hl,(Seed) ; add hl,bc ; ld (Seed),hl ; ld hl,(Seed+2) ; adc hl,de ; res 7,h ; ld (Seed+2),hl ; ret m ; ld hl,Seed ; Rnd1 inc (hl) ; ret nz ; inc hl ; jp Rnd1 ; Seed defw 1234,5678 ; EST defb 1,1,4,5,3,4,5,6,2,5,6,7,8,3,2,6,7; defb 1,2,5,4,1,3,4,5 ; defb 1,2,5,4,1,3,4,1 ; Explode call ShipExplSd ; ld b,90 ; ld iy,ExplData ; Expllp push bc ; ExplKKK call Rand ; ld a,e ; or d ; jr z ExplKKK ; DE = rand, nz ld a,(Seed+2) ; and #1F ; ld l,a ; ld h,0 ; ld bc,EST ; add hl,bc ; ld a,(hl) ; ld (iy+3),a ; ld (iy+4),a ; ld hl,0 ; call InitLine2 ; ld a,(Sp0) ; ld (iy+17),a ; ld a,(SpY) ; ld (iy+18),a ; ld (iy+15),0 ; ld (iy+16),0 ; ld (iy),0 ; pop bc ; ld de,19 ; add iy,de ; djnz Expllp ; ld a,(V0) ; ld b,a ; ld a,(Sp0) ; sub b ; ld b,a ; ld a,(SpY) ; ld l,a ; ld h,0 ; add hl,hl ; ld de,ConYT2 ; add hl,de ; ld a,(hl) ; inc hl ; ld h,(hl) ; add a,b ; ld l,a ; ld b,8 ; ExplKK1 ld (hl),0 ; inc h ; djnz ExplKK1 ; inc l ; ld b,8 ; ExplKK2 dec h ; ld (hl),0 ; djnz ExplKK2 ; ld a,(V0) ; ld (DoP2+1),a ; ld bc,1000 ; Expllp1 push bc ; ld b,90 ; ld ix,ExplData ; ; The explode loop Expllp2 bit 0,(ix) ; jr nz ExplL1 ; dec (ix+3) ; jr nz ExplL1 ; ld a,(ix+4) ; ld (ix+3),a ; push bc ; call MoveBit ; pop bc ; ExplL1 ld de,19 ; add ix,de ; djnz Expllp2 ; ; Move the lazers? pop bc ; Loop counter dec bc ; ld a,c ; or b ; jr nz Expllp1 ; ret ; InitLine2 ld (iy+7),1 ; ld (iy+8),1 ; ld a,l ; sub e ; ld l,a ; jp z ILine2_1A ; jp p ILine2_1 ; neg ; ld (iy+7),#FF ; ILine2_1 ld e,a ; ld a,h ; sub d ; ld h,a ; jp z ILine2_2A ; jp p ILine2_2 ; neg ; ld (iy+8),#FF ; ILine2_2 ld d,a ; sub e ; jr nc ILine2_3 ; ld (iy+12),e ; sra e ; ld (iy+10),e ; ld (iy+11),d ; ld a,(iy+7) ; ld (iy+13),a ; ld (iy+14),0 ; ret ; ILine2_3 ld (iy+12),d ; sra d ; ld (iy+10),d ; ld (iy+11),e ; ld a,(iy+8) ; ld (iy+14),a ; ld (iy+13),0 ; ret ; ILine2_1A ld (iy+7),0 ; jr ILine2_1 ; ILine2_2A ld (iy+8),0 ; jr ILine2_2 ; NextPoint2 ld a,(ix+10) ; sub (ix+11) ; ld (ix+10),a ; jp p NextPoint2_1 ; ld a,(ix+15) ; add a,(ix+7) ; ld (ix+15),a ; ld l,a ; ld a,(ix+16) ; add a,(ix+8) ; ld (ix+16),a ; ld h,a ; ld a,(ix+10) ; add a,(ix+12) ; ld (ix+10),a ; or a ; ret ; NextPoint2_1 ld a,(ix+15) ; add a,(ix+13) ; ld (ix+15),a ; ld l,a ; ld a,(ix+16) ; add a,(ix+14) ; ld (ix+16),a ; ld h,a ; or a ; ret ; MoveBit bit 1,(ix) ; jr z Proj2M2 ; ld l,(ix+5) ; ld h,(ix+6) ; call PjSh2 ; res 1,(ix) ; Proj2M2 call NextP2 ; jr nc DoP2 ; Proj2M3 set 0,(ix) ; ret ; DoP2 ld b,0 ; SMC ld a,(ix+1) ; sub b ; cp 32 ; jr nc Proj2M3 ; ld l,(ix+2) ; ld h,0 ; add hl,hl ; ld de,ConYT2 ; add hl,de ; add a,(hl) ; inc hl ; ld h,(hl) ; ld l,a ; ld (ix+5),l ; ld (ix+6),h ; set 1,(ix) ; jp PjSh2 ; NextP2 call NextPoint2 ; ret c ; ld a,(ix+15) ; sra a ; sra a ; add a,(ix+17) ; ld (ix+1),a ; ld a,(ix+16) ; sra a ; sra a ; add a,(ix+18) ; ld (ix+2),a ; or a ; jp p NextP2_1 ; scf ; ret ; NextP2_1 cp 21 ; ^ ccf ; ret ; PjSh2 ld a,(ix+16) ; and 3 ; add a,a ; sub h ; neg ; add a,6 ; ld h,a ; ld a,(ix+15) ; and 3 ; ld e,a ; ld d,Garb/256 ; ld a,(de) ; xor (hl) ; ld (hl),a ; inc h ; ld a,(de) ; xor (hl) ; ld (hl),a ; ret ; ; These are the AY ports for a 128K machine... pSoundReg equ $FFFD ; pSoundData equ $BFFD ; ChSel equ #E0 ; E0 ShipExplSd mSoundSMC() ; ld hl,BigBang ; jr IS_StartTable ; InitSound mSoundSMC() ; ld hl,InitData ; ld a,1 ; ld (IntDel),a ; IS_StartTable ld e,0 ; InitLoop ld a,e ; ld bc,pSoundReg ; out (c),a ; ld a,(hl) ; ld b,high pSoundData ; out (c),a ; inc hl ; inc e ; ld a,e ; cp 15 ; jr nz InitLoop ; ret ; FuckSd push af ; di ; call KillSd ; call TurnOffSd ; ei ; pop af ; ret ; EnableSd push af ; call TurnOnSd ; call InitSound ; pop af ; ret ; ; Handle making a noise on interrupt InterruptSoundDrv mSoundSMC() ; ld hl,(pLaser) ; ld a,(hl) ; cp #FF ; jr z Int2 ; ld a,9 ; ld bc,pSoundReg ; out (c),a ; ld a,(hl) ; ld b,high pSoundData ; out (c),a ; inc hl ; ld a,2 ; ld b,high pSoundReg ; out (c),a ; ld a,(hl) ; ld b,high pSoundData ; out (c),a ; inc hl ; ld (pLaser),hl ; Int2 ld hl,(pGrab) ; ld a,(hl) ; cp #FF ; jr z Int3 ; ld a,10 ; ld bc,pSoundReg ; Might get here without loading BC out (c),a ; ld a,(hl) ; ld b,high pSoundData ; out (c),a ; inc hl ; ld a,4 ; ld b,high pSoundReg ; out (c),a ; ld a,(hl) ; ld b,high pSoundData ; out (c),a ; inc hl ; ld (pGrab),hl ; Int3 ld hl,(pMut) ; Mutants only . ld a,(IntDel) ; dec a ; ld (IntDel),a ; ret nz ; ld a,SdSpeed ; ld (IntDel),a ; ld a,(hl) ; cp #FF ; jr z Int4 ; ld a,5 ; ld bc,pSoundReg ; Might get here without loading C out (c),a ; ld a,1 ; ld b,high pSoundData ; out (c),a ; ld a,10 ; ld b,high pSoundReg ; out (c),a ; ld a,(hl) ; ld b,high pSoundData ; out (c),a ; inc hl ; ld a,4 ; ld b,high pSoundReg ; out (c),a ; ld a,(hl) ; ld b,high pSoundData ; out (c),a ; inc hl ; ld (pMut),hl ; Int4 ld a,15 ; ld bc,high pSoundReg ; Might get here without loading C out (c),a ; ret ; KillSd mSoundSMC() ; ld a,8 ; ld bc,pSoundReg ; out (c),a ; xor a ; ld b,high pSoundData ; out (c),a ; ld a,9 ; ld b,high pSoundReg ; out (c),a ; xor a ; ld b,high pSoundData ; out (c),a ; ld a,$0A ; ld b,high pSoundReg ; out (c),a ; xor a ; ld b,high pSoundData ; out (c),a ; ret ; mkExplSd mSoundSMC() ; ld a,$0D ; Envelope ld bc,pSoundReg ; out (c),a ; ld a,9 ; |\___ ld b,high pSoundData ; out (c),a ; ld a,7 ; Mixer ld b,high pSoundReg ; out (c),a ; ld a,ChSel ; ld b,high pSoundData ; out (c),a ; ret ; mkProjSd mSoundSMC() ; ; Envelope ld a,$0D ; ld bc,pSoundReg ; out (c),a ; ld a,9 ; ld b,high pSoundData ; out (c),a ; ; Channel ld a,7 ; ld b,high pSoundReg ; out (c),a ; ld a,ChSel or #01 ; ld b,high pSoundData ; out (c),a ; ret ; mkLaserSd ld hl,LaserTable ; ld (pLaser),hl ; ret ; ManGrab push hl ; push de ; push bc ; ld de,#10 ; call AddScore ; ld hl,ManGTab ; ld (pGrab),hl ; pop bc ; pop de ; pop hl ; ret ; ManDrop push hl ; push de ; push bc ; ld de,#10 ; call AddScore ; ld hl,ManDTab ; ld (pGrab),hl ; pop bc ; pop de ; pop hl ; ret ; mkMutSd ld a,r ; and #6 ; ld e,a ; ld d,0 ; ld hl,MutTable ; add hl,de ; ld (pMut),hl ; ret ; InitData defb 3,#A ; defb 0,0 ; defb 0,4 ; defb #14 ; defb ChSel ; defb #10 ; defb #00 ; defb #00 ; defw #400 ; defb 0 ; BigBang defb 1,#F ; Channel A pitch defb 2,#F ; Channel B pitch defb 3,#F ; Channel C pitch defb #1F ; Noise pitch defb #C7 ; I/O I/O TC TB TA NC NB NA defb #10 ; Use envelope defb #10 ; Use envelope defb #10 ; Use envelope defw #6C00 ; Envelope duration defb 9 ; Envelope shape LaserTable defb #F,30 ; defb #F,30 ; defb #F,30 ; defb #E,50 ; defb #E,50 ; defb #E,50 ; defb #D,70 ; defb #D,70 ; defb #C,80 ; defb #B,90 ; defb #A,100 ; defb #9,110 ; defb #8,120 ; defb #7,130 ; defb #6,135 ; defb #5,140 ; defb #4,145 ; defb #3,148 ; defb #2,152 ; defb #1,153 ; defb #0,0 ; defb #FF,0 ; ManGTab defb #F,240 ; defb #F,235 ; defb #F,230 ; defb #F,225 ; defb #E,200 ; defb #E,160 ; defb #E,80 ; defb #D,60 ; defb #D,40 ; defb #C,30 ; defb #C,20 ; defb #B,14 ; defb #A,13 ; defb #9,12 ; defb 0,11 ; defb #FF,11 ; ManDTab defb #F,11 ; defb #F,12 ; defb #F,13 ; defb #F,14 ; defb #E,20 ; defb #E,30 ; defb #E,40 ; defb #D,60 ; defb #D,80 ; defb #C,160 ; defb #C,200 ; defb #B,225 ; defb #A,230 ; defb #8,235 ; defb #0,240 ; defb #FF,240 ; MutTable defb #F,230 ; defb #E,130 ; defb #D,100 ; defb #F,180 ; defb #E,150 ; defb #D,130 ; defb #F,110 ; defb #D,80 ; defb #E,120 ; defb #F,70 ; defb #F,110 ; defb #E,60 ; defb #F,100 ; defb #F,50 ; defb #D,80 ; defb #D,40 ; defb #E,70 ; defb #C,30 ; defb #C,50 ; defb #B,20 ; defb #D,30 ; defb #B,10 ; defb #A,100 ; defb #9,50 ; defb #8,80 ; defb #7,40 ; defb #4,70 ; defb #3,30 ; defb #4,50 ; defb #3,20 ; defb #2,30 ; defb 0,0 ; MutEnd defb #FF,0 ; pLaser defw MutEnd ; pGrab defw MutEnd ; pMut defw MutEnd ; LeaveLine push de ; push bc ; push hl ; ld a,(HSDoneIt) ; or a ; jr nz LLexNC ; call SkipTZ ; ld e,(hl) ; inc hl ; ld d,(hl) ; ld hl,(Score) ; or a ; sbc hl,de ; jr c LLexNC ; jr z LLexNC ; pop hl ; push hl ; ld (HSptr1),hl ; ld l,(ix) ; ld h,(ix+1) ; ld (HSy),hl ; ld a,1 ; ld (HSDoneIt),a ; pop hl ; pop bc ; pop de ; scf ; ret ; LLexNC pop hl ; pop bc ; pop de ; or a ; ret ; SkipTZ push af ; SkipTZl ld a,(hl) ; or a ; jr z SkipTZx ; inc hl ; jr SkipTZl ; SkipTZx inc hl ; pop af ; ret ; Game call InitSound ; call Frame ; Play a sheet push af ; call KillSd ; pop af ; ; A = 0 .. New frame ; A = 1 .. Killed or a ; jr nz Game1 ; call NewFrame ; New Sheet jr Game ; ; Player been killed Game1 ld a,(nShips) ; dec a ; ld (nShips),a ; jr nz Game ; ret ; NewFrame ld l,(iy+pNFrame) ; ld h,(iy+pNFrame+1) ; push hl ; pop iy ; ld a,(nFrames) ; inc a ; daa ; ld (nFrames),a ; call CLS2 ; call InitDisp ; ld hl,pyAWC ; ld (CurY),hl ; ld a,pxAWC ; ld (CurX),a ; ld hl,MessAWC ; call DWMess ; ld a,(nMen) ; or a ; jp z NewFrameE ; ld hl,pyBON ; ld (CurY),hl ; ld a,pxBON ; ld (CurX),a ; ld hl,MessBON ; call DWMess ; ld a,(nMen) ; ld b,a ; ld hl,pyChain ; ld (CurY),hl ; ld a,pxChain ; ld (CurX),a ; ChainLoop push bc ; ld a,0 ; call OutChar ; call ChainDelay ; pop bc ; djnz ChainLoop ; ld hl,MessSCO ; call DWMess ; ld a,(nMen) ; cp 10 ; call nc PrintOne ; or #30 ; call OutChar ; ld hl,MessX ; call DWMess ; ld hl,(ManVal) ; call PrintDec ; ld hl,MessEQ ; call DWMess ; ld a,(nMen) ; ld hl,(ManVal) ; ld d,h ; ld e,l ; Mult dec a ; jr z MultE ; push af ; ld a,l ; add a,e ; daa ; ld l,a ; ld a,h ; adc a,d ; daa ; ld h,a ; pop af ; jr Mult ; MultE ld d,h ; ld e,l ; call AddScore ; call PrintDec ; call DispScore ; call Delay ; NewFrameE ld hl,pyNXT ; ld (CurY),hl ; ld a,pxNXT ; ld (CurX),a ; ld hl,MessNXT ; call DWMess ; ld hl,pnFrame ; ld a,(nFrames) ; rrca ; rrca ; rrca ; rrca ; and #F ; call nz PDig ; ld a,(nFrames) ; and #F ; call PDig ; call Delay ; ld hl,(ManVal) ; ld a,l ; inc a ; daa ; ld l,a ; ld a,h ; adc a,0 ; daa ; ld h,a ; ld (ManVal),hl ; ret ; PrintOne sub 10 ; push af ; ld a,'1' ; call OutChar ; pop af ; ret ; PrintDec push hl ; pop de ; ld c,0 ; ld a,d ; and #F0 ; rrca ; rrca ; rrca ; rrca ; call PDec ; ld a,d ; and #F ; call PDec ; ld a,e ; and #F0 ; rrca ; rrca ; rrca ; rrca ; call PDec ; ld a,e ; and #F ; call PDec ; xor a ; call PDec2 ; ret ; PDec or a ; jr z PDec1 ; ld c,1 ; PDec2 push de ; push bc ; or #30 ; call OutChar ; pop bc ; pop de ; ret ; PDec1 bit 0,c ; jr nz PDec2 ; ret ; ChainDelay ld bc,80 ; jr Del1 ; Delay ld bc,1500 ; Del1 dec bc ; xor a ; Del2 dec a ; jr nz Del2 ; ld a,c ; or b ; jr nz Del1 ; ret ; ret ; Frame push iy ; pop hl ; inc hl ; inc hl ; ld (pWarp),hl ; inc hl ; ld a,(hl) ; ld (WarpTime),a ; ld a,16 ; ld (Shields),a ; ld a,WSI ; ld (WarpSpeed),a ; xor a ; ld (nMenWarped),a ; jp Start ; ; OnInterrupt handle warping someething new in then sound IntJP ld a,(WarpSpeed) ; dec a ; ld (WarpSpeed),a ; jp nz InterruptSoundDrv ; ld a,WSI ; ld (WarpSpeed),a ; ld a,(WarpTime) ; dec a ; ld (WarpTime),a ; jp nz InterruptSoundDrv ; ; Time to warp something in ld ix,(pWarp) ; ld a,(ix) ; or a ; jr z WSetFlag ; cp #90 ; jr nc WarpDisc ; cp #80 ; jr nc WarpMen ; WarpFirst inc ix ; inc ix ; ld (pWarp),ix ; WarpInT call WarpInAcc ; ld a,(ix+1) ; ld (WarpTime),a ; jp InterruptSoundDrv ; WarpMen ld a,(nMenWarped) ; or a ; ld b,a ; jr z WarpMen1 ; WarpMen2 ld a,(nMen) ; cp b ; jr z WarpMenEx ; inc b ; ld a,b ; ld (nMenWarped),a ; ld a,6 ; jr WarpInT ; WarpMen1 ld a,(ix) ; and #F ; jr z WarpMen2 ; ld c,a ; ld a,(nMen) ; add a,c ; cp 12 ; jr c WarpMen1a ; ld a,12 ; WarpMen1a ld (nMen),a ; jr WarpMen2 ; WarpMenEx inc ix ; inc ix ; ld a,(ix) ; jr WarpFirst ; WSetFlag ld a,1 ; ld (Started),a ; ld a,Ldel ; ld (WarpTime),a ; inc ix ; inc ix ; ld (pWarp),ix ; ret ; WarpDisc ld a,(ix+1) ; ld (WarpTime),a ; ld a,4 ; ; Add something (type in A) WarpInAcc or a ; ret z ; push af ; push ix ; call FTTSTg ; pop ix ; jr c WarpIA ; pop af ; Type of thing ld d,a ; push ix ; call WarpItIn ; pop ix ; ret ; WarpIA pop af ; ret ; AddScore push hl ; ld hl,(Score) ; ld a,l ; add a,e ; daa ; ld l,a ; call c Extras ; ld a,h ; adc a,d ; daa ; ld h,a ; jr c Overflow ; ld (Score),hl ; pop hl ; ret ; Overflow call Explode ; Snmart arse jr Overflow ; Extras push af ; ld a,h ; cp #01 ; jr z Extras1 ; cp #03 ; jr z Extras1 ; cp #09 ; jr z Extras1 ; cp #49 ; jr z Extras1 ; pop af ; ret ; Extras1 ld a,(nShips) ; inc a ; ld (nShips),a ; ld a,(nSmarts) ; inc a ; ld (nSmarts),a ; pop af ; ret ; GameLoop ld a,(ScoreD) ; dec a ; ld (ScoreD),a ; ret nz ; ld bc,63486 ; in a,(c) ; bit 0,a ; call z FuckSd ; bit 1,a ; call z EnableSd ; bit 2,a ; jp z GameExit ; bit 3,a ; jp z EntryPt ; DispScore call DispRest ; ld a,ScoreR ; ld (ScoreD),a ; ld de,(Score) ; ld hl,pScore ; DispNo ld c,0 ; ld a,d ; and #F0 ; rrca ; rrca ; rrca ; rrca ; call PDig ; ld a,d ; and #F ; call PDig ; ld a,e ; and #F0 ; rrca ; rrca ; rrca ; rrca ; call PDig ; ld a,e ; and #F ; call PDig ; xor a ; call PDig2 ; ret ; PDig or a ; jr z PDig1 ; ld c,1 ; ; Display a digit PDig2 push hl ; push de ; ld e,a ; ld d,0 ; ld ix,DigTab ; add ix,de ; ld de,10 ; ld b,7 ; PDigL ld a,(ix) ; ld (hl),a ; inc h ; add ix,de ; djnz PDigL ; pop de ; pop hl ; inc l ; ret ; PDig1 bit 0,c ; jr nz PDig2 ; ret ; InitDisp call DispScore ; ld hl,#4000 ; ld (CurY),hl ; ld a,0 ; ld (CurX),a ; ld hl,Mess1 ; call DWMess ; ld hl,#4000 ; ld (CurY),hl ; ld a,#5C ; ld (CurX),a ; ld hl,Mess2 ; call DWMess ; call InitShieldDisplay ; ld hl,#4000 ; ld (CurY),hl ; ld a,#94 ; ld (CurX),a ; ld hl,Mess3 ; call DWMess ; ld hl,#4000 ; ld (CurY),hl ; ld a,#C8 ; ld (CurX),a ; ld hl,Mess4 ; jp DWMess ; CLS2 ld hl,$4000 ; ld de,$4001 ; ld bc,$1800 ; ld (hl),0 ; ldir ; ld bc,$2FF ; ld (hl),$0F ; ldir ; ld a,$01 ; Blue border out ($FE),a ; ret ; Mess1 db "Score",0 ; Mess2 db "Ships",0 ; Mess3 db "Bombs",0 ; Mess4 db "Women",0 ; MessAWC db "Attack Wave Completed",0 ; MessBON db "Bonus for women remaining",0; MessSCO db " i.e. ",0 ; MessNXT db "Prepare for Attack Wave :-",0; MessX db " x ",0 ; MessEQ db " = ",0 ; MessRep db "You scored :- ",0 ; MessSPC db "Press K/J/SPACE to continue.",0; MessJK db "Invasion of the Body Snatchers !",0,0; db "Written by Design Design Software",0,0; db "Simon Brattel and Neil Mottershead",0,0; db "Artwork by Dave de-Leuw",0,0; db "Produced by Design-Design (c) 1983 .. 2018",0; db 0,0,0,0 ; db "Do you want noises?",0 db 0 db "Assuming this is a 128K (etc) machine?",0,0; db 0 db "Press Y or N",0,0 ; db 0,0,0 ; Mess6 db " Invasion of the Body Snatchers !",0,0; db " Hall of Fame",0,0; DispRest ld a,(nShips) ; ld hl,pShips ; call PDig2 ; ld a,(nSmarts) ; ld hl,pBombs ; call PDig2 ; ld a,(nMen) ; ld hl,pMen ; call Mdsp ; ret ; KillMan push ix ; Perhaps a bit excessive on the ol' saving here... push iy ; push hl ; push de ; push bc ; push af ; call KillMan1 ; pop af ; pop bc ; pop de ; pop hl ; pop iy ; pop ix ; ret ; ; Display the number of men Mdsp ld hl,pMen ; cp 10 ; jr c KMsd1 ; ld a,1 ; call PDig2 ; ld a,(nMen) ; sub 10 ; call PDig2 ; ret ; ; Draw the first man counter digit KMsd1 ld b,8 ; KMsd2 ld (hl),0 ; inc h ; djnz KMsd2 ; ld hl,pMen+1 ; ld a,(nMen) ; call PDig2 ; ret ; ; Decrease the number of men KillMan1 ld a,(nMen) ; dec a ; ld (nMen),a ; jp Mdsp ; Update the count nSBombs ld a,(nSmarts) ; ret ; SBombsd ld a,(nSmarts) ; dec a ; ld (nSmarts),a ; ret ; DWMess ld a,(hl) ; or a ; ret z ; inc hl ; push hl ; call OutChar ; pop hl ; jr DWMess ; OutChar push af ; ld l,a ; ld h,0 ; add hl,hl ; add hl,hl ; add hl,hl ; ld de,Cset ; add hl,de ; push hl ; pop ix ; ld a,(CurX) ; rrca ; rrca ; rrca ; and #1F ; ld de,(CurY) ; or e ; ld e,a ; ld a,(CurX) ; and #7 ; ld c,a ; ld b,8 ; OutCharL call GetHL ; ld a,(de) ; xor h ; ld (de),a ; inc e ; ld a,(de) ; xor l ; ld (de),a ; dec e ; inc ix ; inc d ; djnz OutCharL ; pop af ; ld l,a ; ld h,0 ; ld de,Wset ; add hl,de ; ld b,(hl) ; ld a,(CurX) ; add a,b ; ld (CurX),a ; ld a,1 ; ld a,1 ; ld a,1 ; ret ; GetHL ld h,(ix) ; ld l,0 ; ld a,c ; GetHLlp or a ; jr nz GetHLsh ; ret ; GetHLsh dec a ; srl h ; rr l ; jr GetHLlp ; ; Top line of the digits 0 .. 9, then the second line, etc, etc DigTab defb #1C,8,#1C,#3E,4,#3E,#E,#3E,#1C,#1C; defb #22,#18,#22,2,#C,#20,#10,2,#22,#22; defb #26,8,2,4,#14,#3C,#20,4,#22,#22; defb #2A,8,#C,#C,#24,2,#3C,8,#1C,#1E; defb #32,8,#10,2,#3E,2,#22,#10,#22,2; defb #22,8,#20,#22,4,#22,#22,#10,#22,4; defb #1C,#1C,#3E,#1C,4,#1C,#1C,#10,#1C,#38; ; The data for each sheet StartSh defw Sht1 ; defb #80,VSdel ; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 0,1,#FF,Mdel ; Sht1 defw Sht2 ; defb #80,VSdel ; defb 2,Sdel,2,Sdel ; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 0,1,#FF,Mdel ; Sht2 defw Sht3 ; defb #80,VSdel ; defb 2,Sdel,2,Sdel,2,Sdel,2,Sdel; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 0,1,#FF,Mdel ; Sht3 defw Sht4 ; defb #80,VSdel ; defb 2,Sdel,2,Sdel,2,Sdel,3,Sdel; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 0,1,#FF,Mdel ; Sht4 defw Sht5 ; defb #80,VSdel ; defb 2,Sdel,2,Sdel,3,Sdel,3,Sdel; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 0,1,#FF,Mdel ; Sht5 defw Sht6 ; defb #80,VSdel ; defb 2,Sdel,3,Sdel,3,Sdel,3,Sdel; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 0,1,#FF,Mdel ; Sht6 defw Sht7 ; defb #84,VSdel ; defb 2,Sdel,3,Sdel,3,Sdel,3,Sdel; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 0,1,#FF,Mdel ; Sht7 defw Sht8 ; defb #80,VSdel ; defb 2,Sdel,3,Sdel,3,Sdel,3,Sdel; defb 4,Sdel ; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel ; defb 0,1,#FF,Mdel ; Sht8 defw Sht9 ; defb #80,VSdel ; defb 2,Sdel,3,Sdel,3,Sdel,3,Sdel; defb 4,Sdel,4,Sdel ; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel ; defb 0,1,#FF,Sdel ; Sht9 defw ShtA ; defb #80,VSdel ; defb 2,Sdel,3,Sdel,3,Sdel,3,Sdel; defb 4,Sdel,4,Sdel ; defb 5,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Mdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Sdel,1,Sdel ; defb 0,1,#FF,Sdel ; ShtA defw ShtB ; defb #80,VSdel ; defb 2,Sdel,3,Sdel,3,Sdel,3,Sdel; defb 4,Sdel,4,Sdel ; defb 5,Sdel,5,Sdel,1,Sdel,1,Sdel; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 1,Sdel,1,Sdel ; defb 0,1,#FF,Sdel ; ShtB defw ShtC ; defb #80,VSdel ; defb 2,Sdel,3,Sdel,3,Sdel,3,Sdel; defb 4,Sdel,4,Sdel ; defb 5,Sdel,5,Sdel,5,Sdel,5,Sdel; defb 1,Sdel,1,Sdel,1,Sdel,1,Sdel; defb 0,1,#FF,Sdel ; ShtC defw ShtC ; defb #80,VSdel ; defb 2,VSdel,3,VSdel,3,VSdel,3,VSdel; defb 4,VSdel,4,VSdel ; defb 5,VSdel,5,VSdel,5,VSdel,5,VSdel; defb 1,VSdel,1,VSdel,1,VSdel,1,VSdel; defb 1,VSdel,1,VSdel,1,VSdel,1,VSdel; defb 4,VSdel,4,VSdel,4,VSdel,4,VSdel; defb 0,1,#FF,FSdel ; nShips defb 0 ; nMen defb 0 ; Shields defb 0 ; nMenWarped defb 0 ; ManVal defw 0 ; nFrames defb 0 ; nSmarts defb 0 ; Score defw 0 ; ScoreD defb 0 ; pWarp defw 0 ; WarpSpeed defb 0 ; WarpTime defb 0 ; CurX defb 0 ; CurY defw 0 ; HSptr1 defw 0 ; HSptr2 defw 0 ; HSptr3 defw 0 ; HSy defw 0 ; HSDoneIt defb 0 ; FullerConn defb 0 ; IntDel defb 0 ; SaveLimit equ * org $BB00 ; pNewPos defw 0 ; pOldPos defw 0 ; Killed defb 0 ; EndF defb 0 ; Set to leave the sheet Started defb 0 ; This sets EndF after some delay? Explosion? NoMoved defb 0 ; NoRem defb 0 ; LeftF defb 0 ; RightF defb 0 ; UpF defb 0 ; DownF defb 0 ; FireF defb 0 ; FireF1 defb 0 ; IntIngF defb 0 ; HS defb 0 ; nInts defb 0 ; SRt defb 0 ; Dir defb 0 ; nDir defb 0 ; SpX defb 0 ; Sp0 defb 0 ; nSp0 defb 0 ; SpY defb 0 ; nSpY defb 0 ; V0 defb 0 ; nV0 defb 0 ; cSpSh defw 0 ; nSpSh defw 0 ; SppyF defb 0 ; SpDirX defb 0 ; oSpDirX defb 0 ; SpAddr defw 0 ; EntryNo defb 0 ; nMenCarried defb 0 ; BrdC defb 0 ; SmartF1 defb 0 ; SmartF defb 0 ; RadSp defw 0 ; RadWld defb 0 ; RadScr defb 0 ; RadScr1 defb 0 ; KeyS defb 0 ; pRateTl defw 0 ; ds 2 ; Writes after this... AppLast equ * ; align 256 ; IntTab defs $101 ; defs 400 ; DTl defs $800 ; EndDTl defs 400 ; align 256 ; ExplData equ $ ; BigMaze defs $1800 ; MountH defs $100 ; ManH defs $100 ; pTgT defs $200 ; ThingTable defs $1000 ; LrTl defs $100 ; ExTabl defs $800 ; ENDEND equ $ ; align 256 ; IntPage ds $101 ; ; Setup the emulation registers, so Zeus can emulate this code correctly Zeus_PC equ EntryPt ; Tell the emulator where to start ; These generate some output files ; If we want a fancy loader we need to load a loading screen import_bin "new.scr",$4000 ; Load a loading screen ; Now, also generate a tzx file using the loader (not test zeus) output_tzx "iotbs2.tzx","Cheesy","",AppFirst,SaveLimit-AppFirst,3,EntryPt,$04123456 ; A tzx file using the loader output_tap "iotbs2.tap","Cheesy","",AppFirst,SaveLimit-AppFirst,3,EntryPt,$04123456 ; A tap file using the loader output_z80 "iotbs2.z80" ; A z80 file not using the loader