home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d148 / efj.lha / EFJ / EFJ.S < prev    next >
Text File  |  1988-08-15  |  16KB  |  1,097 lines

  1. ; ESCAPE FROM JOVI
  2. ;
  3. ; Written by O.Wagner
  4. ;            Landsberge 5
  5. ;            4322 Sprockhövel 2
  6. ;            West Germany
  7. ;
  8. ; This program is SHAREWARE!
  9. ; It may be copied for any
  10. ; purpose (except selling), as
  11. ; long as the copying license
  12. ; is included. 
  13. ; If you like this program, please
  14. ; send a donation (about 10,-DM, $8)
  15. ; to the author. Include a disk to 
  16. ; obtain new levels, instructions
  17. ; and tools to create your own!
  18. ; If these donation will cover my
  19. ; expenses, I will release more
  20. ; programms on this way!
  21.  
  22.  
  23. ; This source is for the SEKA assembler!
  24.  
  25. rp1=$55dc0
  26. rp2=$55ec0
  27.  
  28. ; Lib-Offsets
  29.  
  30. ; Dos
  31. Open= -30
  32. Close= -36
  33. Read= -42
  34. Write= -48
  35.  
  36. ; Exec
  37. AllocAbs= -204
  38. OldOpenLib= -408
  39.  
  40. ; Gfx
  41. InitBitmap= -390
  42. InitRastPort= -198
  43. Move= -240
  44. RectFill= -306
  45. SetAPen= -342
  46. SetBPen= -348
  47. SetDrMd= -354
  48. Text= -60
  49. WaitTOF= -270
  50. Draw= -246
  51. CopInit= 50
  52.  
  53.  move.l 4.w,a6
  54.  lea $50000,a1
  55.  move.l #$20000,d0
  56.  jsr AllocAbs(a6)
  57.  lea dosname,a1
  58.  jsr OldOpenLib(a6)
  59.  move.l d0,dosbase
  60.  lea gfxname,a1
  61.  jsr OldOpenLib(a6)
  62.  move.l d0,gfxbase
  63.  
  64. ; load data
  65.  bsr.L loaddat
  66.  bsr.l loadhi
  67.  
  68. ; grafix setup
  69.  bsr.L initrps
  70.  bsr.l initpf
  71.  move.l CopInit(a6),gfxsave
  72.  move.l #clist,CopInit(a6)
  73.  
  74. ; some sound setup
  75.  move.l #svoid,d0
  76.  move.l d0,$dff0a0
  77.  move.l d0,$dff0b0
  78.  move.l d0,$dff0c0
  79.  move.l d0,$dff0d0
  80.  moveq #1,d0
  81.  move d0,$dff0a4
  82.  move d0,$dff0b4
  83.  move d0,$dff0c4
  84.  move d0,$dff0d4
  85.  move #$800f,$dff096
  86.  
  87. mainloop:
  88.  bsr.L introtitle
  89. ; (dirty!!!) quit if left
  90. ; mousebutton is pressed 
  91.  btst #6,$bfe001
  92.  bne.s w2
  93.  move.l gfxsave,CopInit(a6)
  94.  move.l #$f,$dff096
  95.  rts
  96.  w2: 
  97.  move.l #clist,CopInit(a6)
  98.  move.b #3,ships
  99.  clr.w score
  100.  clr.b level
  101.  move.b #145,maxfuel
  102.  move.b #99,maxtime
  103.  bsr.L cls
  104. leveloop:
  105.  lea rp1,a1
  106.  moveq #1,d0
  107.  jsr SetAPen(a6)
  108.  lea pleasewait,a0
  109.  moveq #115,d0
  110.  move d0,d1
  111.  bsr.l print
  112.  bsr.l viewscore
  113.  move.b level,d0
  114.  bsr.l loadlevel 
  115. gameloop:
  116.  move #1070,d0
  117.  bsr.l gotoline
  118.  bsr.l fadein
  119.  move.b #130,$56001
  120.  bsr.l spriteon
  121.  move.b maxfuel,fuel
  122.  move.l #1070*1024,ypos
  123.  move.l #260*1024,xpos
  124.  clr xspe
  125.  clr yspe
  126.  move.b maxtime,time
  127.  bsr.L viewscore
  128.  bsr.l viewships
  129.  bsr.l viewhi
  130.  bsr.l viewtime
  131.  bsr.l viewfuel
  132.  move.b #50,tcount
  133.  move #%11010011010,$dff098
  134.  move $dff00e,d0
  135. maingameloop:
  136.  jsr WaitTOF(a6)
  137.  subq.b #1,rcount
  138.  bne.s mgl99
  139.  rol #1,$56012
  140.  move.b #6,rcount
  141. mgl99:
  142.  subq.b #1,tcount
  143.  bne.s mgl1
  144.  subq.b #1,time
  145.  beq.L crash
  146.  move.b #50,tcount
  147. mgl1: 
  148.  clr.l d1
  149.  clr d7
  150.  tst.b fuel
  151.  beq.L mgl6 ; no fuel left
  152.  bsr.l joyask
  153.  move d0,d7
  154.  bne.s mgls
  155.  bsr.L soff
  156.  bra.s mgl6
  157. mgls:
  158.  move.l #$5f000,$dff0d0
  159.  move #1486/2,$dff0d4
  160.  move #415,$dff0d6
  161.  move #35,$dff0d8
  162.  move.l #$5f000,$dff0c0
  163.  move #1486/2,$dff0c4
  164.  move #451,$dff0c6
  165.  move #29,$dff0c8
  166.  
  167.  subq.b #1,fuelc
  168.  bne.s mgl6
  169.  subq.b #1,fuel
  170.  move.b #20,fuelc
  171. mgl6:
  172.  move d7,d0
  173.  btst #2,d0
  174.  beq.s mgl2
  175.  sub #15,yspe
  176. mgl2:
  177.  btst #3,d0
  178.  beq.s mgl4
  179.  add #14,yspe
  180. mgl4:
  181.  addq #5,yspe
  182.  move yspe,d1
  183.  bmi.s mgl3
  184.  add.l d1,ypos
  185.  bra.s mgl5
  186. mgl3:
  187.  neg d1
  188.  sub.l d1,ypos
  189. mgl5:
  190.  btst #0,d0
  191.  beq.s mgl7
  192.  sub #14,xspe
  193. mgl7:
  194.  btst #1,d0
  195.  beq.s mgl8
  196.  add #14,xspe
  197. mgl8:
  198.  clr.l d1
  199.  move xspe,d1
  200.  bpl.s mgl9
  201.  neg d1
  202.  sub.l d1,xpos
  203.  bra.s mgl10
  204. mgl9:
  205.  add.l d1,xpos
  206.  
  207. mgl10:
  208.  move.l xpos,d1
  209.  asr.l #8,d1
  210.  asr.l #2,d1
  211.  bclr #0,$56003
  212.  btst #0,d1
  213.  beq.s mgl11
  214.  bset #0,$56003
  215. mgl11: 
  216.  asr #1,d1
  217.  move.b d1,$56001
  218.  
  219.  move.l ypos,d0
  220.  asr.l #8,d0
  221.  asr.l #2,d0
  222.  move.l d0,d7
  223.  bsr.l gotoline  
  224.  cmp #50,d7
  225.  ble.L youmadeit 
  226.  move $dff00e,d0
  227.  and #%100010,d0
  228.  bne.s crash
  229.  bsr.l viewfuel
  230.  bsr.l viewtime
  231.  bra.L maingameloop 
  232.  
  233. crash:
  234.  bsr.l bumm
  235.  bsr.l viewtime
  236.  bsr.l spriteoff
  237.  bsr.L fadeout
  238.  
  239.  subq.b #1,ships
  240.  bsr.L viewships
  241.  tst.b ships
  242.  bne.L gameloop
  243.  bsr.l dohiscore
  244.  lea rp1,a1
  245.  moveq #1,d0
  246.  jsr SetDrMd(a6)
  247.  moveq #1,d0
  248.  jsr SetAPen(a6)
  249.  moveq #0,d0
  250.  jsr SetBPen(a6)
  251.  lea gameovert,a0
  252.  move #115,d0
  253.  move #115,d1
  254.  bsr.l print
  255.  moveq #85,d3
  256. gameoverw2:
  257.  jsr WaitTOF(a6)
  258.  dbf d3,gameoverw2
  259.  bra.L mainloop
  260. youmadeit:
  261.  bsr.l soff
  262.  lea rp1,a1
  263.  moveq #1,d0 
  264.  jsr SetDrMd(a6)
  265.  moveq #3,d0
  266.  jsr SetAPen(a6)
  267.  moveq #0,d0
  268.  jsr SetBPen(a6)
  269.  lea ymit,a0
  270.  move #102,d0
  271.  move #80,d1
  272.  bsr.l print
  273.  clr.l d0
  274.  clr.l d1
  275.  move.b fuel,d0
  276.  move.b time,d1
  277.  add d0,d1
  278.  moveq #0,d0
  279.  move.b level,d0
  280.  addq.b #1,d0
  281.  mulu d0,d1
  282.  add d1,score
  283.  addq.b #1,level
  284.  bsr.L spriteoff
  285.  bra.L leveloop
  286. xpos: dc.l 160*1024
  287. ypos: dc.l 1070*1024
  288. xspe: dc.w 0
  289. yspe: dc.w 0
  290.  
  291. ymit: dc.b "YOU MADE IT!",0
  292. gameovert: dc.b "GAME OVER",0
  293. even
  294. score: dc.w 0
  295. ships: dc.b 0
  296. level: dc.b 0
  297. fuel: dc.b 200
  298. maxfuel: dc.b 145
  299. fuelc: dc.b 10
  300. time: dc.b 99
  301. maxtime: dc.b 99
  302. tcount: dc.b 50
  303. rcount: dc.b 5
  304.  
  305. pleasewait:
  306.  dc.b "GET READY",0
  307. even
  308. dosname:
  309.  dc.b "dos.library",0
  310. dosbase:
  311.  dc.l "WWS"
  312. gfxname:
  313.  dc.b "graphics.library",0,"!"
  314. gfxsave:
  315.  dc.l "WWS"
  316. gfxbase:
  317.  dc.l "WWS"
  318. clist:
  319.  dc.w $00e0,$0005,$00e2,$0000
  320.  dc.w $00e4,$0006,$00e6
  321. add1:
  322.  dc.w $000
  323.  dc.w $00e8,$0005,$00ea,8000
  324.  dc.w $00ec,$0006,$00ee
  325. add2:
  326.  dc.w $000
  327.  dc.w $00f0,$0005,$00f2,16000
  328.  
  329.  dc.w $0120,$0005,$0122
  330. spadd:
  331.  dc.w $6000
  332.  
  333.  
  334.  dc.w $0100,%101011000000000
  335.  dc.w $0102,0
  336.  dc.w $0092,$0038,$0094,$00d0
  337.  dc.w $008e,$2c81,$0090,$f4c1
  338.  
  339.  dc.w $0180,0
  340.  dc.w $0182,$0f00
  341.  dc.w $0184,$0555
  342.  dc.w $0186,$0777
  343.  dc.w $0188,$0999
  344.  dc.w $018a,$0bbb
  345.  dc.w $018c,$0ddd
  346.  dc.w $018e,$0
  347.  
  348.  dc.w $01a2
  349. spcol:
  350.  dc.w $04a4
  351.  
  352.  dc.w $0196
  353. pf2clr:
  354.  dc.w $0c80
  355.  
  356.  dc.w $3701,$ff00,$0182,$0d00
  357.  dc.w $3a01,$ff00,$0182,$0a00
  358.  dc.w $4001,$ff00,$0182,$0f00
  359.  dc.w $4b01,$ff00,$0182,$0d00
  360.  dc.w $4f01,$ff00,$0182,$0a00
  361.  
  362.  dc.w $5501,$ff00,$0182,$0565
  363.  dc.w $6501,$ff00,$0182,$0fff
  364.  dc.w $6d01,$ff00,$0182,$0565
  365.  
  366.  dc.w $7401,$ff00,$0182,$004e
  367.  dc.w $7d01,$ff00,$0182,$004b
  368.  dc.w $8001,$ff00,$0182,$0048
  369.  
  370.  dc.w $8601,$ff00,$0182,$00f5
  371.  dc.w $9201,$ff00,$0182,$00e5
  372.  dc.w $9c01,$ff00,$0182,$00d4
  373.  dc.w $a601,$ff00,$0182,$00c4
  374.  dc.w $b001,$ff00,$0182,$00b3
  375.  
  376.  dc.w $c001,$ff00,$0182,$0c40
  377.  dc.w $e001,$ff00,$0182,$0fff
  378.  
  379.  dc.w $ffff,$fffe
  380.  
  381. spritedat:
  382.  dc.w $a085,$aa00
  383.  dc.w %0000001111000000,0
  384.  dc.w %0001111111111000,0
  385.  dc.w %0011111111111100,0
  386.  dc.w %1111111111111111,%1110111011101110
  387.  dc.w %1111111111111111,0
  388.  dc.w %0111111111111110,0
  389.  dc.w %0001000000001000,0
  390.  dc.w %0001000000001000,0
  391.  dc.w %0010100000010100,%0001000000001000
  392.  dc.w %0111110000111110,0
  393.  dc.l 0
  394. gotoline: ; line -> d0
  395.  mulu #40,d0
  396.  move d0,add1
  397.  move d0,add2
  398.  rts
  399.  
  400. spriteon:
  401.  move.w #$6000,spadd
  402.  move $dff00e,scorebuff
  403.  rts
  404. spriteoff:
  405.  move.w #$6040,spadd
  406.  rts
  407.  
  408. initrps:
  409.  lea spritedat,a0
  410.  lea $56000,a1
  411.  moveq #10,d0
  412. initrps1:
  413.  clr.l $40(a1)
  414.  move.l (a0)+,(a1)+
  415.  dbf d0,initrps1
  416.  lea bm1,a0
  417.  moveq #3,d0
  418.  move #320,d1
  419.  move #200,d2
  420.  jsr InitBitMap(a6)
  421.  lea bm2,a0
  422.  moveq #1,d0
  423.  move #320,d1
  424.  move #1424,d2
  425.  jsr InitBitMap(a6)
  426.  lea rp1,a1
  427.  jsr InitRastPort(a6) 
  428.  move.l #bm1,rp1+4
  429.  lea rp2,a1
  430.  jsr InitRastPort(a6)
  431.  move.l #bm2,rp2+4
  432.  rts
  433. bm1:
  434.  dc.l 0,0,$50000,$50000+8000,$50000+8000
  435. bm2:
  436.  dc.l 0,0,$60000
  437.  
  438. coltab:
  439.  dc.w $0c80,$0b70,$0a60,$0960,$0850,$0740,$0640,$0530
  440.  dc.w $0320,$0220,$0110,0
  441. fadein:
  442.  lea coltab+22,a0
  443.  lea pf2clr,a1
  444.  moveq #10,d0
  445. fadein1:
  446.  move.w -(a0),(a1)
  447.  move.w #$2fff,d1
  448. fadein2:
  449.  dbf d1,fadein2
  450.  dbf d0,fadein1
  451.  rts
  452. fadeout:
  453.  lea coltab,a0
  454.  lea pf2clr,a1
  455.  moveq #11,d0
  456. fadeout1:
  457.  move.w (a0)+,(a1)
  458.  move.w #$2fff,d1
  459. fadeout2:
  460.  dbf d1,fadeout2
  461.  dbf d0,fadeout1
  462.  rts
  463.  
  464.  
  465. initpf:
  466.  lea rp2,a1
  467.  moveq #0,d0
  468.  jsr SetAPen(a6)
  469.  moveq #0,d0
  470.  move d0,d1
  471.  move #319,d2
  472.  move #199,d3
  473.  jsr RectFill(a6)
  474.  lea rp2,a1
  475.  moveq #1,d1
  476.  jsr SetAPen(a6)
  477.  moveq #0,d0
  478.  move #1224,d1
  479.  move #319,d2
  480.  move #1423,d3
  481.  jsr RectFill(a6)
  482.  
  483.  
  484. print: ; add -> a0, x -> d0, y -> d1
  485.  move.l a3,-(sp)
  486.  move.l a0,a3
  487.  lea rp1,a1
  488.  jsr Move(a6)
  489.  moveq #0,d0
  490.  move.l a3,a0
  491.  lea rp1,a1
  492. print1:
  493.  addq #1,d0
  494.  tst.b (a3)+
  495.  bne.s print1
  496.  subq #1,d0
  497.  move.l (sp)+,a3
  498.  jmp Text(a6)
  499.  
  500. title:
  501.  lea rp1,a1
  502.  moveq #0,d0
  503.  jsr SetDrMd(a6)
  504.  bsr.L cls
  505.  lea rp1,a1
  506.  moveq #1,d0
  507.  jsr SetAPen(a6)
  508.  lea ttxt1,a0
  509.  move #92,d0
  510.  move #63,d1
  511.  bsr.s print
  512.  lea rp1,a1
  513.  move #90,d0
  514.  move #52,d1
  515.  jsr Move(a6)
  516.  move #220,d0
  517.  move #52,d1
  518.  jsr Draw(a6)
  519.  move #90,d0
  520.  move #68,d1
  521.  lea rp1,a1
  522.  jsr Move(a6)
  523.  move #220,d0
  524.  move #68,d1
  525.  jsr Draw(a6) 
  526.  
  527.  lea hinames+48,a5
  528.  lea hiscores+8,a4
  529.  moveq #4,d7
  530. writescores:
  531.  lea rp1,a1
  532.  move #133,d0
  533.  move d7,d1
  534.  mulu #10,d1
  535.  add #100,d1
  536.  move d1,d6
  537.  jsr Move(a6)
  538.  move.l a5,a0
  539.  moveq #12,d0
  540.  jsr Text(a6) 
  541.  move.w (a4),d0
  542.  move #83,d1
  543.  move d6,d2
  544.  bsr.L pscore
  545.  sub.l #12,a5
  546.  sub.l #2,a4
  547.  dbra d7,writescores  
  548.  lea ttxt2,a0
  549.  moveq #40,d0
  550.  move #190,d1
  551.  bsr.L print
  552.  lea ttxt3,a0
  553.  moveq #81,d0
  554.  move #165,d1
  555.  bsr.l print
  556.  lea ttxt4,a0
  557.  moveq #108,d0
  558.  moveq #85,d1
  559.  bsr.l print
  560.  rts
  561.  
  562. ttxt4:
  563.  dc.b "HALL OF FAME",0
  564. ttxt3:
  565.  dc.b "PRESS FIRE TO START",0
  566. ttxt2:
  567.  dc.b "Written and © 1988 by O.Wagner",0
  568. ttxt1:
  569.  dc.b "ESCAPE FROM JOVI",0
  570. even
  571.  
  572. hiscores:
  573.  dc.w 500,400,300,200,100
  574. hinames:
  575.  dc.b "The Werewolf"
  576.  dc.b "The Werewolf"
  577.  dc.b "The Werewolf"
  578.  dc.b "The Werewolf"
  579.  dc.b "The Werewolf"
  580.  
  581. pscore:
  582.  movem.l d3/d4,-(sp)
  583.  lea scorebuff,a0
  584.  move d0,d3
  585.  divu #10000,d3 
  586.  move d3,d4
  587.  mulu #10000,d3
  588.  sub d3,d0
  589.  add.b #"0",d4
  590.  move.b d4,(a0)+
  591.  move d0,d3
  592.  divu #1000,d3
  593.  move d3,d4
  594.  mulu #1000,d3
  595.  sub d3,d0
  596.  add.b #"0",d4
  597.  move.b d4,(a0)+
  598.  
  599.  move d0,d3
  600.  divu #100,d3
  601.  move d3,d4
  602.  mulu #100,d3
  603.  sub d3,d0
  604.  add.b #"0",d4
  605.  move.b d4,(a0)+
  606.  move d0,d3
  607.  divu #10,d3
  608.  move d3,d4
  609.  mulu #10,d3
  610.  sub d3,d0
  611.  add.b #"0",d4
  612.  move.b d4,(a0)+
  613.  add.b "0",d0
  614.  move.b d4,(a0)
  615.  lea scorebuff,a0
  616.  move d1,d0
  617.  move d2,d1
  618.  bsr.L print
  619.  movem.l (sp)+,d3/d4
  620.  rts
  621. scorebuff:
  622.  dc.b "00000",0
  623.  
  624. cls:
  625.  lea rp1,a1
  626.  moveq #0,d0
  627.  jsr SetAPen(a6)
  628.  moveq #10,d0
  629.  moveq #50,d1
  630.  move #310,d2
  631.  move #192,d3
  632.  jmp RectFill(a6)
  633.  
  634. introtitle:
  635.  bsr.l spriteoff
  636.  bsr.L title
  637.  moveq #0,d7
  638.  move d7,d0
  639.  bsr.l gotoline
  640.  move #$0c80,pf2clr
  641.  
  642. wait:
  643.  move d7,d0
  644.  bsr.l gotoline 
  645.  addq #1,d7
  646.  cmp #1199,d7
  647.  beq.s wait2
  648. wait1:
  649.  jsr WaitTOF(a6)
  650.  btst #7,$bfe001
  651.  beq.s waitcont
  652.  bra.s wait
  653. wait2:
  654.  move d7,d0
  655.  bsr.l gotoline
  656.  subq #1,d7
  657.  beq.s wait
  658.  jsr WaitTOF(a6)
  659.  btst #7,$bfe001
  660.  beq.s waitcont
  661.  bra.s wait2
  662. waitcont:
  663.  bsr.s cls
  664.  rts
  665.  
  666. loadlevel:
  667.  move.b d0,scorebuff
  668.  bsr.L fadeout
  669.  move.b scorebuff,d0
  670.  cmp.b levinmem,d0
  671.  beq.s loadlevelret
  672. loadlevel1:
  673.  move.l dosbase,a6
  674.  move.b d0,levinmem
  675.  add.b #"0",d0
  676.  move.b d0,levname+2
  677.  move.l #levname,d1
  678.  move.l #1005,d2 ; ACCESS_READ
  679.  jsr Open(a6) 
  680.  tst.l d0
  681.  bne.s loadlevel2
  682.  moveq #0,d0 ; now, have to
  683.  clr.b level ; start over
  684.  sub.b #10,maxfuel ; things getting
  685.  sub.b #10,maxtime ; harder...
  686.  addq.b #1,ships
  687.  bra.s loadlevel1
  688. loadlevel2:
  689.  move.l d0,d6
  690.  move.l d6,d1
  691.  move.l #$61f40,d2
  692.  move.l #40960,d3
  693.  jsr Read(a6)
  694.  move.l d6,d1
  695.  jsr Close(a6)
  696.  move.l gfxbase,a6  
  697.  move.l #clist,CopInit(a6)
  698. loadlevelret:
  699.  bra.L cls
  700. levinmem:
  701.  dc.b 0
  702. even
  703. levname:
  704.  dc.b "l00",0
  705. buff:
  706.  dc.w 0 
  707.  
  708. viewships:
  709.  move.b ships,d0
  710.  add.b #"0",d0
  711.  move.b d0,buff
  712.  move #194,d0
  713.  move #14,d1
  714.  lea rp1,a1
  715.  jsr Move(a6)
  716.  lea buff,a0
  717.  lea rp1,a1
  718.  moveq #1,d0
  719.  jmp Text(a6)
  720.  
  721. viewhi:
  722.  move hiscores,d0
  723.  move #250,d1
  724.  moveq #14,d2
  725.  bra.L pscore
  726.  
  727. viewfuel:
  728.  lea rp1,a1
  729.  move #33,d1
  730.  move #60,d0
  731.  jsr Move(a6)
  732.  move #33,d1
  733.  moveq #0,d0
  734.  move.b fuel,d0
  735.  add #60,d0
  736.  jsr Draw(a6)
  737.  lea rp1,a1
  738.  moveq #7,d0
  739.  jsr SetAPen(a6)
  740.  move #33,d1
  741.  move #210,d0
  742.  jsr Draw(a6)
  743.  moveq #1,d0
  744.  lea rp1,a1
  745.  jmp SetAPen(a6)
  746.   
  747. viewtime:
  748.  lea rp1,a1
  749.  move #285,d0
  750.  move #36,d1
  751.  jsr Move(a6)
  752.  clr.l d0
  753.  move.b time,d0
  754.  divu #10,d0
  755.  move d0,d1
  756.  mulu #10,d0
  757.  move.b time,d2
  758.  sub d0,d2
  759.  add.b #"0",d1
  760.  move.b d1,buff
  761.  lea buff,a0
  762.  add.b #"0",d2
  763.  move.b d2,buff+1
  764.  moveq #2,d0
  765.  jmp Text(a6) 
  766.  
  767. viewscore:
  768.  lea rp1,a1
  769.  moveq #2,d0
  770.  jsr SetAPen(a6)
  771.  moveq #7,d0
  772.  jsr SetBPen(a6)
  773.  moveq #1,d0
  774.  jsr SetDrMd(a6)
  775.  move score,d0
  776.  move #73,d1
  777.  move #14,d2
  778.  bra.L pscore
  779.  
  780. joyask:
  781.  clr.l d0
  782.  movem.l d1-d3,-(sp)
  783.  move.w $dff00c,d1
  784.  btst #9,d1
  785.  beq.s joyask1
  786.  bset #0,d0
  787. joyask1:
  788.  btst #1,d1
  789.  beq.s joyask2
  790.  bset #1,d0
  791. joyask2:
  792.  move d1,d2
  793.  move d1,d3
  794.  and #2,d2
  795.  and #1,d3
  796.  asr #1,d2
  797.  eor d2,d3
  798.  beq.s joyask3
  799.  bset #3,d0
  800. joyask3:
  801.  move d1,d2
  802.  move d1,d3
  803.  and #256,d2
  804.  and #512,d3
  805.  asr #1,d3
  806.  eor d2,d3
  807.  beq.s joyask4
  808.  bset #2,d0
  809. joyask4:
  810.  btst #7,$bfe001
  811.  bne.s joyask5
  812.  bset #7,d0
  813. joyask5:
  814.  movem.l (sp)+,d1-d3
  815.  rts
  816.  
  817. dohiscore:
  818.  move score,d0
  819.  cmp hiscores+8,d0
  820.  bge.s dohiscore1
  821.  rts
  822. dohiscore1:
  823.  move.l #"    ",hiscon
  824.  move.l #"    ",hiscon+4
  825.  move.l #"    ",hiscon+8
  826.  bsr.L cls
  827.  lea rp1,a1
  828.  moveq #1,d0
  829.  jsr SetAPen(a6)
  830.  moveq #0,d0
  831.  jsr SetDrMd(a6)
  832.  lea shs1,a0
  833.  move #40,d0
  834.  move #78,d1
  835.  bsr.l print
  836.  lea shs2,a0
  837.  move #56,d0
  838.  move #108,d1
  839.  bsr.l print
  840.  lea shs3,a0
  841.  move #56,d0
  842.  move #124,d1
  843.  bsr.l print
  844.  lea shs4,a0
  845.  move #56,d0
  846.  move #140,d1
  847.  bsr.l print 
  848.  lea rp1,a1
  849.  move #105,d0
  850.  move #186,d1
  851.  jsr Move(a6)
  852.  move #207,d0
  853.  move #186,d1
  854.  jsr Draw(a6) 
  855.  moveq #2,d0
  856.  jsr SetDrMd(a6)
  857.  moveq #1,d6
  858.  move d6,d7
  859.  moveq #0,d5
  860.  lea hiscon,a5
  861.  bsr.L drawhiblock
  862. dohiloop:
  863.  bsr.L joyask
  864.  tst.b d0
  865.  beq.s dohiloop
  866.  move.b d0,scorebuff
  867.  bsr.L drawhiblock
  868.  move.b scorebuff,d0
  869.  btst #0,d0
  870.  beq.s dohiloop1
  871.  subq #1,d6
  872.  bne.s dohiloop1
  873.  moveq #13,d6
  874. dohiloop1:
  875.  btst #1,d0
  876.  beq.s dohiloop2
  877.  addq #1,d6
  878.  cmp #14,d6
  879.  bne.s dohiloop2
  880.  moveq #1,d6
  881. dohiloop2:
  882.  btst #2,d0
  883.  beq.s dohiloop3
  884.  subq #1,d7
  885.  bne.s dohiloop3
  886.  moveq #3,d7
  887. dohiloop3:
  888.  btst #3,d0
  889.  beq.s dohiloop4
  890.  addq #1,d7
  891.  cmp #4,d7
  892.  bne.s dohiloop4
  893.  moveq #1,d7
  894. dohiloop4:
  895.  btst #7,d0
  896.  bne.s dohientry
  897.  bsr.L drawhiblock
  898. dohiwait:
  899.  move #9,d4
  900. dohiloop5:
  901.  jsr WaitTOF(a6)
  902.  dbf d4,dohiloop5
  903.  bra.s dohiloop
  904. dohientry:
  905.  bsr.L drawhiblock
  906.  move d6,d0
  907.  move d7,d1
  908.  subq #1,d0
  909.  subq #1,d1
  910.  mulu #13,d1
  911.  add d1,d0
  912.  lea scht,a0
  913.  move.b (a0,d0),d0
  914.  cmp.b #"~",d0
  915.  beq.s dohirub
  916.  cmp.b #"`",d0
  917.  beq.s dohiend
  918.  cmp.b #12,d5
  919.  beq.L dohiwait 
  920.  move.b d0,(a5,d5)
  921.  addq.b #1,d5
  922. dohiwrite:
  923.  lea rp1,a1
  924.  moveq #1,d0
  925.  jsr SetDrMd(a6)
  926.  moveq #0,d0
  927.  jsr SetBPen(a6)
  928.  moveq #1,d0
  929.  jsr SetAPen(a6)
  930.  move.l a5,a0
  931.  move #108,d0
  932.  move #183,d1
  933.  bsr.l print
  934.  bra.s dohiwait 
  935.  rts
  936. dohirub:
  937.  tst.b d5
  938.  beq.L dohiwait
  939.  subq.b #1,d5
  940.  move.b #" ",(a5,d5)
  941.  bra.L dohiwrite
  942. dohiend:
  943.  move score,d0
  944.  moveq #4,d1
  945.  cmp hiscores+6,d0
  946.  ble.L dohiname
  947.  move hiscores+6,hiscores+8
  948.  move.l hinames+36,hinames+48
  949.  move.l hinames+40,hinames+52
  950.  move.l hinames+44,hinames+56
  951.  moveq #3,d1
  952.  cmp hiscores+4,d0
  953.  ble.L dohiname
  954.  move hiscores+4,hiscores+6
  955.  move.l hinames+24,hinames+36
  956.  move.l hinames+28,hinames+40
  957.  move.l hinames+32,hinames+44
  958.  moveq #2,d1
  959.  cmp hiscores+2,d0
  960.  ble.s dohiname
  961.  move hiscores+2,hiscores+4
  962.  move.l hinames+12,hinames+24
  963.  move.l hinames+16,hinames+28
  964.  move.l hinames+20,hinames+32
  965.  moveq #1,d1
  966.  cmp hiscores,d0
  967.  ble.s dohiname
  968.  move hiscores,hiscores+2 
  969.  move.l hinames,hinames+12
  970.  move.l hinames+4,hinames+16
  971.  move.l hinames+8,hinames+20
  972.  moveq #0,d1
  973. dohiname:
  974.  move d1,d2
  975.  rol #1,d2
  976.  lea hiscores,a0
  977.  move d0,(a0,d2)
  978.  lea hinames,a0
  979.  mulu #12,d1
  980.  move.l hiscon,(a0,d1)
  981.  move.l hiscon+4,4(a0,d1)
  982.  move.l hiscon+8,8(a0,d1)
  983. ; now we gonna save the list
  984.  move.l gfxsave,CopInit(a6)
  985.  move.l dosbase,a6
  986.  move.l #hilistname,d1
  987.  move.l #1006,d2 ; ACCESS_WRITE
  988.  jsr Open(a6)
  989.  move.l d0,d7
  990.  beq.s hiret
  991.  move.l d0,d1
  992.  move.l #hiscores,d2
  993.  move.l #70,d3
  994.  jsr -48(a6)
  995.  move.l d7,d1
  996.  jsr Close(a6)
  997. hiret:
  998.  move.l gfxbase,a6
  999.  move.l CopInit(a6),gfxsave
  1000.  move.l #clist,CopInit(a6) 
  1001.  add #4,a7
  1002.  bra.L mainloop
  1003.  
  1004. hilistname:
  1005.  dc.b "EFJ_HiScores",0
  1006.  even
  1007. drawhiblock:
  1008.  lea rp1,a1
  1009.  moveq #2,d0
  1010.  jsr SetDrMd(a6)
  1011.  moveq #16,d1
  1012.  mulu d7,d1
  1013.  add #84,d1
  1014.  move d1,d3
  1015.  add #11,d3
  1016.  moveq #16,d0
  1017.  mulu d6,d0
  1018.  add #38,d0
  1019.  move d0,d2
  1020.  add #11,d2
  1021.  lea rp1,a1
  1022.  jmp RectFill(a6) 
  1023.  rts
  1024.  
  1025.  
  1026. scht:
  1027.  dc.b "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ~`"
  1028. shs1:
  1029.  dc.b "NEW HISCORE - ENTER YOUR NAME",0
  1030. shs2:
  1031.  dc.b "A B C D E F G H I J K L M",0
  1032. shs3:
  1033.  dc.b "N O P Q R S T U V W X Y Z",0
  1034. shs4:
  1035.  dc.b "0 1 2 3 4 5 6 7 8 9   « ×",0
  1036. even
  1037. hiscon:
  1038.  dc.b "            ",0 ; yep, 12 !
  1039. even
  1040. svoid:
  1041.  dc.w 0
  1042. bumm:
  1043.  move.l #$59000,$dff0a0
  1044.  move.l #$59000,$dff0b0
  1045.  move #19670/2,$dff0a4
  1046.  move #19670/2,$dff0b4
  1047.  move #580,$dff0a6
  1048.  move #579,$dff0b6
  1049.  move #65,$dff0a8
  1050.  move #65,$dff0b8
  1051.  move #$ffff,d0
  1052. bumm1:
  1053.  move d0,$dff1a2
  1054.  dbf d0,bumm1
  1055.  move #1,$dff0a4
  1056.  move #1,$dff0b4
  1057.  move.l #svoid,$dff0a0
  1058.  move.l #svoid,$dff0b0
  1059. soff:
  1060.  move #1,$dff0c4
  1061.  move #1,$dff0d4
  1062.  move.l #svoid,$dff0c0
  1063.  move.l #svoid,$dff0d0
  1064.  rts
  1065.  
  1066. loadhi:
  1067.  move.l dosbase,a6
  1068.  move.l #hilistname,d1
  1069.  move.l #1005,d2
  1070.  jsr Open(a6)
  1071.  move.l d0,d7
  1072.  beq.s loadhiret
  1073.  move.l #hiscores,d2
  1074.  move.l d0,d1
  1075.  move.l #70,d3
  1076.  jsr Read(a6)
  1077.  move.l d7,d1
  1078.  jsr Close(a6)
  1079. loadhiret:
  1080.  move.l gfxbase,a6
  1081.  rts
  1082.  
  1083. loaddat:
  1084.  move.l dosbase,a6
  1085.  move.l #datname,d1
  1086.  move.l #1005,d2
  1087.  jsr Open(a6)
  1088.  move.l d0,d7
  1089.  move.l #$50000,d2
  1090.  move.l d0,d1
  1091.  move.l d2,d3
  1092.  jsr Read(a6)
  1093.  move.l d7,d1
  1094.  jmp Close(a6)
  1095. datname:
  1096.  dc.b "EFJ_data",0
  1097.