;Robot EHEU, programmed by Jude Hungerford. Work started on 1/11/2000. ;Last modified on 31/5/2001. ;Version 0.91 ;This robot owes ideas, but no direct code, to Warblade, Zitgun, JX19, ;AceBot, and probably a whole host of other 'bots. ;Modlist: ;Previous bits of modlist in their own file. Email me at ;lichen_dragon@my-deja.com if you want to see it. ;0.43 - 0.44: ;It now fires an extra shot in its firing routine. ;I really should fix the sticking on walls bug. ;That didn't work against fast-moving enemies, so I'm removing it. ;fixed up the !lock code a little. ;0.44 - 0.45: ;Fixing the problems with sticking on walls. ;Worked with my second idea. The first failed. It still sticks on walls, but ;much less often. I'll try to fix it completely someday. The next task, ;though, is quite a large one- make it modify its firing adjustment angles ;during the game. It should be possible, but the coding will be hard. ;0.45 - 0.46: ;Adding the dynamic firing adjustment change code. Well, figuring out how to ;do it and then writing it, rather- it's not quite as simple as just adding ;some new code, sadly. ;I've done some preliminary code reorganisation to prepare for it. That's all ;for this version. ;0.46 - 0.48: ;0.47 didn't work, but might still have some interest. I'm skipping it for ;the moment, though. ;I've just found out that the new steering code changes actually make it ;stick on the walls all the time. Damn. I'll fix that now. ;0.48 - 0.49: ;Not really fixed yet. Making more adjustments. ;Still not fixed, but improved slightly. ;0.49 - 0.50: ;Currently, it's normally "best marksman" but also "most conservative". I'd ;like to try to speed up the radar scanning code, and I might try to further ;improve the accuracy. ;I've improved the radar scan code. Firing adjustments for next version. ;0.50 - 0.53: ;Intermediate versions were steps back, so I'm skipping them. ;0.53 - 0.54: ;I wrote some new driving routines for another robot called Nero (who I am ;going to leave for the moment...). I like these driving routines, and am ;going to incorporate them into Eheu to see what happens. ;They were written for a very fast-moving robot, which Eheu isn't and hasn't ;been for quite some time. I think fast 'bots are probably fundamentally ;better, but it depends on exactly how fast they are... I'll try this with ;Eheu's current configuration, but then I might try some other configs. ;Definitely looks like an improvement. ;0.54 - 0.57: ;Skipping intermediate versions of robot because they were bad. ;I've a new idea for allowing the scanner to lock onto really fast robots: ;if they move above a certain speed, when I narrow the arc, I employ the ;firing routines' target prediction to keep the lock. ;0.57 - 0.59: ;doing another jump... ;Changing the scan routine so it has a "locate" and a "sweep" mode, to make ;it more able to deal with fast 'bots. ;New mod works well, it seems. Next version... make it move fast. ;0.59 - 0.61: ;Another skip. ;Taking a look at the scanning code... ;!! ;lots of unnecessary slow crap there, I've cut it. That should improve ;performance. ;0.61 - 0.62: ;Basically, this 'bot is just a little too slow (processor-wise). Will try to ;tidy it, slim it, make it faster. ;0.62 - 0.63: ;That was an improvement overall, I think, now to try to streamline it even ;further... ;looking into a much tidier way of doing the target prediction, inspired by ;AceBot2.8. ;0.63 - 0.64: ;Okay, trying to integrate the new prediction table. :) ;0.64 - 0.65: ;My logic is fubar. ;Needs rewriting... ;new bits, anyway... some of the old stuff is okay. ;New tables implemented... ;Needing lots of fixing... ;0.65 - 0.66: ;More fixing. My logic is a little less fubar now, but it's still not looking ;up the values on the table correctly. ;0.67 - 0.72: ;Intermediate versions were offshoots of 0.68 for a competition. ;Continuing work on the prediction table. The sad thing is, I think my table ;is just plain wrong. Needs fixing. :( ;Well, new table is in place and is being tweaked, but I think it's wrong as ;well... really should get a table that's _correct_. ;0.74 - 0.75: ;New format for prediction table, hopefully to fix everything. :) ;Looks like I've gotten a partial success, at least. :) ;0.75 - 0.76: ;further work getting the table lookup right. ;whatever - 0.79: ;I stopped work on this for ages, now resuming. New firing offset table. I ;think I may have gotten this one right. :) Now to try to integrate it... ;Looks like a good result. :) Still needs tweaking. ;0.79 - 0.82: ;tring to get the lookup code right. ;0.82 - 0.83: ;I realised that I had an error in the program that was calculating the ;lookup table. Fixed it, new table inserted. ;0.83 - 0.84: ;another revised table. ; - 0.88: ;more tables, revisions, etc... ;I think the table's now as big as it can realistically be. Anything more and ;I start exceeding the 1024 compiled line limit. ;0.88 - 0.89: ;added a turning function. ;0.89 - 0.90: ;added extra firing code for fast targets ;0.90 - 0.91: ;try moving fast jmp !init ;** ;** ;* firing offset table ;** ;** ;Start: memory location 1029. ; Speed: 0 ; trajectory 0-256, step 2 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 ; Speed: 64 ; trajectory 0-256, step 2 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 * 256 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 256 256 256 256 * 256 256 256 256 * 256 256 256 256 ; Speed: 128 ; trajectory 0-256, step 2 * 256 256 256 256 * 256 256 256 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 258 * 258 258 258 258 * 258 258 258 258 * 258 258 258 258 * 258 258 258 258 * 258 258 258 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 254 * 254 254 254 254 * 254 254 254 254 * 254 254 254 254 * 254 254 254 254 * 254 254 254 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 256 * 256 256 256 256 ; Speed: 192 ; trajectory 0-256, step 2 * 256 256 256 256 * 256 257 257 257 * 257 257 257 257 * 257 258 258 258 * 258 258 258 258 * 258 258 258 258 * 258 258 258 258 * 259 259 259 259 * 259 259 259 259 * 259 258 258 258 * 258 258 258 258 * 258 258 258 258 * 258 258 258 258 * 257 257 257 257 * 257 257 257 257 * 257 256 256 256 * 256 256 256 256 * 256 255 255 255 * 255 255 255 255 * 255 254 254 254 * 254 254 254 254 * 254 254 254 254 * 254 254 254 254 * 253 253 253 253 * 253 253 253 253 * 253 254 254 254 * 254 254 254 254 * 254 254 254 254 * 254 254 254 254 * 255 255 255 255 * 255 255 255 255 * 255 256 256 256 ; Speed: 256 ; trajectory 0-256, step 2 * 256 256 256 256 * 257 257 257 257 * 257 257 258 258 * 258 258 258 258 * 258 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 258 258 258 258 * 258 258 258 258 * 257 257 257 257 * 257 257 256 256 * 256 256 256 256 * 255 255 255 255 * 255 255 254 254 * 254 254 254 254 * 254 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 254 254 254 254 * 254 254 254 254 * 255 255 255 255 * 255 255 256 256 ; Speed: 320 ; trajectory 0-256, step 2 * 256 256 256 257 * 257 257 257 257 * 258 258 258 258 * 258 259 259 259 * 259 259 259 259 * 260 260 260 260 * 260 260 260 260 * 260 260 260 260 * 260 260 260 260 * 260 260 260 260 * 260 260 260 260 * 260 259 259 259 * 259 259 259 259 * 258 258 258 258 * 258 257 257 257 * 257 257 256 256 * 256 256 256 255 * 255 255 255 255 * 254 254 254 254 * 254 253 253 253 * 253 253 253 253 * 252 252 252 252 * 252 252 252 252 * 252 252 252 252 * 252 252 252 252 * 252 252 252 252 * 252 252 252 252 * 252 253 253 253 * 253 253 253 253 * 254 254 254 254 * 254 255 255 255 * 255 255 256 256 ; Speed: 384 ; trajectory 0-256, step 2 * 256 256 256 257 * 257 257 257 258 * 258 258 258 259 * 259 259 259 259 * 260 260 260 260 * 260 260 260 261 * 261 261 261 261 * 261 261 261 261 * 261 261 261 261 * 261 261 261 261 * 261 261 261 260 * 260 260 260 260 * 260 260 259 259 * 259 259 258 258 * 258 258 258 257 * 257 257 257 256 * 256 256 256 255 * 255 255 255 254 * 254 254 254 253 * 253 253 253 253 * 252 252 252 252 * 252 252 252 251 * 251 251 251 251 * 251 251 251 251 * 251 251 251 251 * 251 251 251 251 * 251 251 251 252 * 252 252 252 252 * 252 252 253 253 * 253 253 254 254 * 254 254 254 255 * 255 255 255 256 ; Speed: 448 ; trajectory 0-256, step 2 * 256 256 257 257 * 257 257 258 258 * 258 259 259 259 * 259 260 260 260 * 260 260 261 261 * 261 261 261 261 * 262 262 262 262 * 262 262 262 262 * 262 262 262 262 * 262 262 262 262 * 262 261 261 261 * 261 261 261 260 * 260 260 260 260 * 259 259 259 259 * 258 258 258 258 * 257 257 257 256 * 256 256 255 255 * 255 255 254 254 * 254 253 253 253 * 253 252 252 252 * 252 252 251 251 * 251 251 251 251 * 250 250 250 250 * 250 250 250 250 * 250 250 250 250 * 250 250 250 250 * 250 251 251 251 * 251 251 251 252 * 252 252 252 252 * 253 253 253 253 * 254 254 254 254 * 255 255 255 256 ; Speed: 512 ; trajectory 0-256, step 2 * 256 256 257 257 * 257 258 258 258 * 259 259 259 259 * 260 260 260 261 * 261 261 261 261 * 262 262 262 262 * 262 262 263 263 * 263 263 263 263 * 263 263 263 263 * 263 263 263 262 * 262 262 262 262 * 262 262 261 261 * 261 261 260 260 * 260 260 259 259 * 259 258 258 258 * 257 257 257 256 * 256 256 255 255 * 255 254 254 254 * 253 253 253 253 * 252 252 252 251 * 251 251 251 251 * 250 250 250 250 * 250 250 249 249 * 249 249 249 249 * 249 249 249 249 * 249 249 249 250 * 250 250 250 250 * 250 250 251 251 * 251 251 252 252 * 252 252 253 253 * 253 254 254 254 * 255 255 255 256 ; Speed: 576 ; trajectory 0-256, step 2 * 256 256 257 257 * 257 258 258 259 * 259 259 260 260 * 260 261 261 261 * 261 262 262 262 * 262 263 263 263 * 263 263 263 263 * 264 264 264 264 * 264 264 264 264 * 264 264 263 263 * 263 263 263 263 * 262 262 262 262 * 261 261 261 261 * 260 260 260 259 * 259 259 258 258 * 258 257 257 256 * 256 256 255 255 * 255 254 254 253 * 253 253 252 252 * 252 251 251 251 * 251 250 250 250 * 250 249 249 249 * 249 249 249 249 * 248 248 248 248 * 248 248 248 248 * 248 248 249 249 * 249 249 249 249 * 250 250 250 250 * 251 251 251 251 * 252 252 252 253 * 253 253 254 254 * 254 255 255 256 ; Speed: 640 ; trajectory 0-256, step 2 * 256 256 257 257 * 258 258 258 259 * 259 260 260 260 * 261 261 261 262 * 262 262 263 263 * 263 263 264 264 * 264 264 264 264 * 264 265 265 265 * 265 265 265 265 * 264 264 264 264 * 264 264 264 263 * 263 263 263 262 * 262 262 262 261 * 261 260 260 260 * 259 259 259 258 * 258 257 257 256 * 256 256 255 255 * 254 254 254 253 * 253 252 252 252 * 251 251 251 250 * 250 250 249 249 * 249 249 248 248 * 248 248 248 248 * 248 247 247 247 * 247 247 247 247 * 248 248 248 248 * 248 248 248 249 * 249 249 249 250 * 250 250 250 251 * 251 252 252 252 * 253 253 253 254 * 254 255 255 256 ; Speed: 704 ; trajectory 0-256, step 2 * 256 256 257 257 * 258 258 259 259 * 260 260 260 261 * 261 262 262 262 * 263 263 263 264 * 264 264 264 265 * 265 265 265 265 * 265 265 265 265 * 265 265 265 265 * 265 265 265 265 * 265 265 264 264 * 264 264 263 263 * 263 262 262 262 * 261 261 261 260 * 260 259 259 258 * 258 257 257 256 * 256 256 255 255 * 254 254 253 253 * 252 252 252 251 * 251 250 250 250 * 249 249 249 248 * 248 248 248 247 * 247 247 247 247 * 247 247 247 247 * 247 247 247 247 * 247 247 247 247 * 247 247 248 248 * 248 248 249 249 * 249 250 250 250 * 251 251 251 252 * 252 253 253 254 * 254 255 255 256 ; Speed: 768 ; trajectory 0-256, step 2 * 256 256 257 257 * 258 258 259 259 * 260 260 261 261 * 262 262 262 263 * 263 264 264 264 * 265 265 265 265 * 266 266 266 266 * 266 266 266 266 * 266 266 266 266 * 266 266 266 266 * 266 265 265 265 * 265 264 264 264 * 263 263 263 262 * 262 261 261 261 * 260 260 259 259 * 258 258 257 257 * 256 256 255 255 * 254 254 253 253 * 252 252 251 251 * 250 250 250 249 * 249 248 248 248 * 247 247 247 247 * 246 246 246 246 * 246 246 246 246 * 246 246 246 246 * 246 246 246 246 * 246 247 247 247 * 247 248 248 248 * 249 249 249 250 * 250 251 251 251 * 252 252 253 253 * 254 254 255 255 ; Speed: 832 ; trajectory 0-256, step 2 * 256 256 257 258 * 258 259 259 260 * 260 261 261 262 * 262 263 263 263 * 264 264 265 265 * 265 266 266 266 * 266 267 267 267 * 267 267 267 267 * 267 267 267 267 * 267 267 267 267 * 266 266 266 266 * 265 265 265 264 * 264 264 263 263 * 262 262 261 261 * 260 260 259 259 * 258 258 257 257 * 256 256 255 254 * 254 253 253 252 * 252 251 251 250 * 250 249 249 249 * 248 248 247 247 * 247 246 246 246 * 246 245 245 245 * 245 245 245 245 * 245 245 245 245 * 245 245 245 245 * 246 246 246 246 * 247 247 247 248 * 248 248 249 249 * 250 250 251 251 * 252 252 253 253 * 254 254 255 255 ; Speed: 896 ; trajectory 0-256, step 2 * 256 256 257 258 * 258 259 259 260 * 260 261 262 262 * 263 263 264 264 * 265 265 265 266 * 266 266 267 267 * 267 267 268 268 * 268 268 268 268 * 268 268 268 268 * 268 268 268 267 * 267 267 267 266 * 266 266 265 265 * 265 264 264 263 * 263 262 262 261 * 261 260 260 259 * 258 258 257 257 * 256 256 255 254 * 254 253 253 252 * 252 251 250 250 * 249 249 248 248 * 247 247 247 246 * 246 246 245 245 * 245 245 244 244 * 244 244 244 244 * 244 244 244 244 * 244 244 244 245 * 245 245 245 246 * 246 246 247 247 * 247 248 248 249 * 249 250 250 251 * 251 252 252 253 * 254 254 255 255 ; Speed: 960 ; trajectory 0-256, step 2 * 256 256 257 258 * 258 259 260 260 * 261 261 262 262 * 263 264 264 265 * 265 265 266 266 * 267 267 267 268 * 268 268 268 269 * 269 269 269 269 * 269 269 269 269 * 269 269 269 268 * 268 268 267 267 * 267 266 266 266 * 265 265 264 264 * 263 263 262 262 * 261 260 260 259 * 259 258 257 257 * 256 256 255 254 * 254 253 252 252 * 251 251 250 250 * 249 248 248 247 * 247 247 246 246 * 245 245 245 244 * 244 244 244 243 * 243 243 243 243 * 243 243 243 243 * 243 243 243 244 * 244 244 245 245 * 245 246 246 246 * 247 247 248 248 * 249 249 250 250 * 251 252 252 253 * 253 254 255 255 ; Speed: 1024 ; trajectory 0-256, step 2 * 256 256 257 258 * 259 259 260 260 * 261 262 262 263 * 263 264 265 265 * 266 266 267 267 * 267 268 268 268 * 269 269 269 269 * 270 270 270 270 * 270 270 270 270 * 270 270 269 269 * 269 269 268 268 * 268 267 267 266 * 266 265 265 264 * 264 263 263 262 * 261 261 260 260 * 259 258 257 257 * 256 256 255 254 * 253 253 252 252 * 251 250 250 249 * 249 248 247 247 * 246 246 245 245 * 245 244 244 244 * 243 243 243 243 * 242 242 242 242 * 242 242 242 242 * 242 242 243 243 * 243 243 244 244 * 244 245 245 246 * 246 247 247 248 * 248 249 249 250 * 251 251 252 252 * 253 254 255 255 ;Turret Offset table ;3205 * 256 256 256 256 * 256 256 256 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 255 * 254 254 254 254 * 254 254 254 254 * 254 254 254 254 * 254 254 254 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 253 * 253 253 253 254 * 254 254 254 254 * 254 254 254 254 * 254 254 254 254 * 254 254 255 255 * 255 255 255 255 * 255 255 255 255 * 255 255 255 256 * 256 256 256 256 * 256 256 256 256 * 256 256 256 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 257 * 258 258 258 258 * 258 258 258 258 * 258 258 258 258 * 258 258 258 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 259 * 259 259 259 258 * 258 258 258 258 * 258 258 258 258 * 258 258 258 258 * 258 258 257 257 * 257 257 257 257 * 257 257 257 257 * 257 257 257 256 * 256 256 256 256 !init #config scanner= 2 #config weapon= 3 #config armor= 3 #config engine= 3 #config heatsinks= 1 #def wpc #def ang #def turn ;how much to turn #def rh ;relative heading #def ts ;target speed #def o ;pos/neg offset flag #def off ;firing offset #def tof ;turret offset out 11, 100 ;full throttle. out 22, 8 ;lay mine, trigger 8. out 17, 16 ;128 degree scan arc. mov DX, 16 mov AX, 1 int 3 ;keepshift on. int 4 ;overburn on mov turn, 5 out 22, 8 ;lay mine, trigger 8. jmp !steer !path out 11, 100 cmp @9, 200 ;Have we travelled 200 metres? jgr !steer ;if yes, steer. int 12 ;collisions? cmp FX, 0 jgr !crash ;if yes, respond to crash. out 14, turn jmp !scan !crash int 13 ;reset collision count. !steer int 19 ;clear meters count. jmp !checkpos ;steer. !scan in 7, BX ;scan cmp BX, 1500 ;anyone in sight? jge !nonefound ;adjust scan arc to suit. jls !arcmodf ;modify arc & fire. !nonefound cmp DX, 16 ;Are we at maximum scan width already? je !flip ;if yes, flip turret. shl DX, 1 ;else, double DX and out 17, DX ;set new scans to DX width. jmp !path ;path !flip out 12, 31 ;turn turret 31 degrees. jmp !path ;path !arcmodf cmp DX, 2 ;is scan angle 2 degrees? jle !fire ;if yes, fire. Else: shr DX, 1 ;halve DX out 17, DX ;set scans to DX. cmp @3, 0 ;is enemy in centre? jgr !accright ;if right, respond jls !accleft ;if left, respond. jmp !fire ;fire !accright out 12, DX ;turn radar right by scanarc. cmp @3, 2 ;is it out by +2? jls !fire ;if less, fire out 12, DX ;turn radar right by 200% scanarc. jmp !fire ;fire !accleft mov BX, DX ;set BX=scanarc neg BX ;and negate BX out 12, BX ;turn radar left by scanarc. cmp @3, -2 ;is it out by -2? jgr !fire ;if more, fire. out 12, BX ;turn radar left by 200% scanarc. jmp !fire ;fire !fire out 12, @3 ;correct turret. in 2, BX ;check heat. cmp BX, 200 ;too hot? jgr !lock ;if yes, lock. Else: cmp @7, 0 ;Is target stationary? je !statfire ;if yes, fire at stationary target. Else: mov ts, @13 ;target speed mov rh, @6 ;relative heading cmp ts, 0 jge !ps neg ts add rh, 128 and rh, 255 !ps shr ts, 6 shl ts, 7 shr rh, 1 mov off, 1028 add off, ts add off, rh mov tof, 3205 add tof, @1 mov off, [off] add off, [tof] jmp !fireadj !statfire ; mov AX, 1 ; ; int 4 ;Overburn= on. out 15, 0 ;fire out 15, 0 ;fire out 15, 0 ;fire out 15, 0 ;fire ; mov AX, 0 ; ; int 4 ;Overburn = off. jmp !lock ;lock. !lock in 7, BX ;scan out 12, @3 ;adjust turret jmp !scan ;and scan !checkpos mov wpc, 0 int 2 ;get x and y co-ordinates. cmp ex, 500 jls !wwall ;west side jge !ewall ;east side !wwall cmp fx, 500 jle !wwalln ;northwest jgr !wwalls ;southwest !wwalln cmp ex, fx ;closer to west or north wall? jle !wnq ;closer to west jgr !nwq ;closer to north !wwalls sub fx, 1000 neg fx ;distance rather than co-ord. cmp ex, fx ;closer to west or south wall? jle !wsq ;closer to west jgr !swq ;closer to south !ewall cmp fx, 500 jle !ewalln ;northeast jgr !ewalls ;southeast !ewalln sub ex, 1000 neg ex ;distance rather than co-ord. cmp ex, fx ;closer to east or north wall? jle !enq ;closer to east jgr !neq ;closer to north !ewalls cmp ex, fx ;closer to east or south wall? jge !esq ;closer to east jls !seq ;closer to south !wnq mov ang, 112 ;desired heading sub ang, @1 ;difference out 14, ang ;turn to desired heading neg turn jmp !scan !nwq mov ang, 80 ;desired heading sub ang, @1 ;difference out 14, ang ;turn to desired heading neg turn jmp !scan !wsq mov ang, 16 ;desired heading sub ang, @1 ;difference out 14, ang ;turn to desired heading neg turn jmp !scan !swq mov ang, 48 ;desired heading sub ang, @1 ;difference out 14, ang ;turn to desired heading neg turn jmp !scan !enq mov ang, 144 ;desired heading sub ang, @1 ;difference out 14, ang ;turn to desired heading neg turn jmp !scan !neq mov ang, 176 ;desired heading sub ang, @1 ;difference out 14, ang ;turn to desired heading neg turn jmp !scan !esq mov ang, 240 ;desired heading sub ang, @1 ;difference out 14, ang ;turn to desired heading neg turn jmp !scan !seq mov ang, 208 ;desired heading sub ang, @1 ;difference out 14, ang ;turn to desired heading neg turn jmp !scan !fireadj ;adjusted firing routine. out 12, off out 15, 0 ;fire w/ new angle. mov ang, @2 ;turret heading = desired heading sub ang, @1 add ang, 32 out 14, ang jmp !lock