home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 86 / asm / source / bm86.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  29.8 KB  |  1,481 lines

  1. ;blockdude 86 is a tcpa game by Brandon Sterner
  2. ;this is not the most recent version of blockdude 86
  3. ;some how the most recent version has been lost
  4.  
  5. #include ti86asm.inc
  6. #include asm86.h
  7. #include ti86abs.inc
  8. #define equ .equ
  9. #define EQU .equ
  10. #define end .end
  11. ;    name    location    bytes and description
  12. #define mx    apd_buf        ;1 x coor of man
  13. #define my    apd_buf+1    ;1 y coor of man
  14. #define x    apd_buf+2    ;1 generic x
  15. #define y    apd_buf+3    ;1 generic y
  16. #define curloc    apd_buf+4    ;2 current location of compressed data
  17. #define height  apd_buf+6    ;1
  18. #define width    apd_buf+7    ;1
  19. #define guyloc    apd_buf+8    ;2 location of guy in boardmap
  20. #define toploc    apd_buf+10    ;2 location of the top left square in screen
  21. #define direction apd_buf+12    ;1 direction of man; 0 if left; not 0 if right
  22. #define carry    apd_buf+13    ;1 if the dude is carrying something =1 if not =0
  23. #define textloc apd_buf+14    ;2 bytes
  24. #define textxy    apd_buf+16    ;2 bytes
  25. #define option    apd_buf+18    ;1 byte    
  26. #define options    apd_buf+19    ;1 byte
  27. #define mode    apd_buf+20    ;1 byte flag; demo(1) or play(0) mode
  28. #define counter apd_buf+21    ;1 byte timing moves
  29. #define mask    apd_buf+22    ;1 mask for decompressing
  30. #define password apd_buf+23    ;4 3 bytes will be chars the last being the zero terminated string
  31. #define byte    apd_buf+27    ;6 a clear buffer
  32. #define level    apd_buf+33    ;1 the # of the level you are on
  33. #define secbuf    apd_buf+34    ;4 buffer for secret presses
  34. #define levloc    apd_buf+34+4    ;2 location of the current level
  35. #define passloc    apd_buf+36+4    ;2 location in passbuff
  36. #define passbuff apd_buf+38+4    ;3 an inputted password
  37. #define char    apd_buf+41+4    ;1 current char# in the inout routine 
  38. #define page    apd_buf+46    ;1
  39. #define boardmap apd_buf+50    ;651 bytes of data
  40.  
  41. apd_buf    = $8265
  42.  
  43. GET_KEY  equ _getky
  44. get_key  equ _getky
  45. pencol equ _penCol
  46. data equ $9400
  47. vidmem equ $9000
  48. plotsscreen = vidmem
  49. graph_mem = vidmem
  50. _ILINE = _ILine
  51. .org _asm_exec_ram
  52.  
  53.     nop
  54.     jp ProgStart
  55.     .dw 0
  56.     .dw ShellTitle
  57. ShellTitle:
  58.  .db    "Block Dude - TCPA",0
  59. Prog_Start:
  60. prog_start:
  61. ProgStart:
  62.  call _runindicoff
  63.  set    1,(iy+$05)    ;
  64.  ld    hl,password
  65.  ld    (hl),0
  66.  ld    de,password+1
  67.  ld    bc,14
  68.  ldir            ;needed zeros for byte,password, and level
  69.  
  70.  call    erasescreen
  71.  call _grbufcpy_v
  72.  call    loaddemo
  73.  call _grbufcpy_v
  74.  
  75.  ld    hl,endtxt
  76.  ld    de,57*256+21
  77.  ld    a,4
  78.  call    choosemode
  79.  xor    a
  80.  ld    (mode),a
  81.  
  82.  ld    a,(option)
  83.  cp    4
  84.  jp    z,new
  85.  cp    3
  86.  jr    z,enterpass
  87.  dec    a
  88.  ret    z            ;exit
  89. loadhelp:
  90.  call    erasescreen    ;clear graph buffer
  91.  call     _grbufcpy_v
  92.  ld    hl,instructions
  93.  ld    a,1
  94.  ld    (page),a
  95. loadhelp2:
  96.  ld a,16
  97.  ld (x),a
  98.  xor a
  99.  ld    (y),a
  100.  ld    b,10
  101.  
  102. loadhelp3:
  103.  push    bc
  104.  ld    de,(x)
  105.  ld    (pencol),de
  106.  call    _vputs
  107.  ld    a,(y)
  108.  add    a,6
  109.  ld    (y),a
  110.  pop    bc
  111.  djnz    loadhelp3
  112.  push    hl
  113.  call    get2nd
  114.  call     _grbufcpy_v
  115.  pop    hl
  116.  ld    a,(page)
  117.  inc    a
  118.  ld    (page),a
  119.  cp    3
  120.  jr    nz,loadhelp2
  121.  jp    prog_start
  122. enterpass:
  123.  call    box
  124.  ld    hl,please
  125.  ld    de,256*24+44
  126.  ld    (pencol),de
  127.  call    _vputs
  128.  ld    de,256*31+42
  129.  ld    (pencol),de
  130.  call    _vputs
  131. ; call _grbufcpy_v
  132.  ld    bc,256*38+58
  133.  call    input
  134.  
  135.  ld    hl,level1-1
  136.  ld    (curloc),hl
  137.  xor    a
  138.  ld    (level),a
  139. checkpass:
  140.  ld    hl,(curloc)
  141.  ld    (levloc),hl
  142.  ld    ix,passbuff-1
  143.  ld    c,3
  144. checkpass2:
  145.  inc    hl
  146.  inc    ix
  147.  ld    a,(hl)
  148.  ld    b,a
  149.  ld    a,(ix)
  150.  cp    b
  151.  jr    nz,nextcheck
  152.  dec    c
  153.  jr    nz,checkpass2
  154.  ld    hl,(levloc)
  155.  ld    (curloc),hl
  156.  jr    setuplevel            ;found level
  157. nextcheck:
  158.  ld    hl,(levloc)
  159.  ld    bc,4
  160.  add    hl,bc
  161.  ld    (curloc),hl
  162.  call    erasemap
  163.  ld    a,(level)
  164.  inc    a
  165.  ld    (level),a
  166.  cp    11
  167.  jr    nz,checkpass
  168.  
  169. new:
  170.  xor    a
  171.  ld    (level),a
  172.  ld    hl,level1-1    ;beginning of compressed data
  173.  ld    (curloc),hl
  174.  
  175. setuplevel:
  176.  ld    a,(level)
  177.  inc    a
  178.  ld    (level),a
  179.  cp    12
  180.  jp    z,message2
  181.  ld    hl,(curloc)
  182.  ld    (levloc),hl    ;in case you want to restart level
  183.  inc    hl        ;if we are on a level>1 then we just decompressed this byte so we need to increment
  184.  ld    de,password
  185.  ld    bc,3
  186.  ldir
  187.  ld    (curloc),hl
  188.  call    erasemap
  189.  call    box
  190.  ld    hl,leveltxt
  191.  ld    de,27*256+43    ;y,x
  192.  ld    (pencol),de
  193.  call    _vputs
  194.  ld    a,(level)
  195.  ld    l,a
  196.  ld    h,0
  197.  call    disphl
  198.  
  199.  
  200.  ld    hl,passtxt
  201.  ld    de,36*256+43    ;y,x
  202.  ld    (pencol),de
  203.  call    _vputs
  204.  ld    hl,password
  205.  call    _vputs
  206.  
  207. ; call _grbufcpy_v
  208.  call    get2nd
  209.  call    dispall
  210.  
  211. main:
  212.  call _grbufcpy_v
  213. ;check if clear was pressed
  214.  ld    b,0fdh 
  215.  call    Direct_Input
  216.  cp    %10111111
  217.  jp    z,message1
  218.  ld     b,0bfh 
  219.  call     Direct_Input
  220. ;check if 2nd was pressed
  221.  cp     %11011111
  222.  jr     z,scan
  223.  
  224.  ld    b,0FEh
  225.  call    Direct_Input
  226.  cp    %11110111
  227.  call    z,up
  228.  cp    %11111110 
  229.  call    z,down
  230.  cp    %11111101
  231.  call    z,left
  232.  cp    %11111011
  233.  call    z,right
  234.  
  235.  jr    main
  236. scan:
  237.  ld    hl,(toploc)
  238.  push    hl
  239. scan2:
  240.  halt
  241.  ld    b,0FEh
  242.  call    Direct_Input
  243.  cp    %11110111
  244.  call    z,checkup2
  245.  cp    %11111110 
  246.  call    z,checkdown2
  247.  cp    %11111101
  248.  call    z,checkleft2
  249.  cp    %11111011
  250.  call    z,checkright2
  251.  call    dispall
  252.  call _grbufcpy_v
  253.  halt
  254.  ld     b,0bfh 
  255.  call     Direct_Input
  256. ;check if 2nd was pressed
  257.  cp     %11011111
  258.  jr     z,scan2
  259.  pop    hl
  260.  ld    (toploc),hl
  261.  call    dispall
  262.  jr    main
  263.  
  264. Direct_Input:
  265.  ld    a,0ffh
  266.  out    (1),a
  267.  ld    a,b
  268.  out    (1),a
  269.  in    a,(1)
  270.  ret
  271. left:
  272.  ld    ix,(guyloc)
  273.  ld    a,(ix-1)
  274.  cp    3
  275.  jp    z,nextlevel
  276.  or    a
  277.  jr    nz,left4    ;can't walk through a wall you idiot!
  278.  ld    a,(carry)
  279.  or    a
  280.  jr    z,left3
  281.  ld    a,(ix-32)
  282.  or    a
  283.  jr    z,left2
  284.  ld    (ix),2
  285.  xor    a
  286.  ld    (ix-31),a
  287.  ld    (carry),a
  288.  jr    left31
  289. left2:
  290.  ld    (ix-31),a
  291.  ld    (ix-32),2
  292. left3:
  293.  ld    (ix),0
  294. left31:
  295.  dec    ix
  296. left4:
  297.  ld    (ix),4
  298.  ld    (guyloc),ix
  299.  xor    a
  300.  ld    (direction),a
  301.  call    checkleft
  302.  call    checkfall
  303.  jp    dispall
  304.  
  305. right:
  306.  ld    ix,(guyloc)
  307.  ld    a,(ix+1)
  308.  cp    3
  309.  jp    z,nextlevel
  310.  or    a
  311.  jr    nz,right4    ;can't walk through a wall you idiot!
  312.  ld    a,(carry)
  313.  or    a
  314.  jr    z,right3    ;no carry
  315.  ld    a,(ix-30)
  316.  or    a
  317.  jr    z,right2
  318.  ld    (ix),2
  319.  xor    a
  320.  ld    (ix-31),a
  321.  ld    (carry),a
  322.  jr    right31
  323. right2:
  324.  ld    (ix-31),a
  325.  ld    (ix-30),2
  326. right3:
  327.  ld    (ix),0
  328. right31:
  329.  inc    ix
  330. right4:
  331.  ld    (ix),5
  332.  ld    (guyloc),ix
  333.  ld    a,1
  334.  ld    (direction),a
  335.  call    checkright
  336.  call    checkfall
  337.  jp    dispall
  338.  
  339. up:
  340.  ld    ix,(guyloc)
  341.  ld    a,(ix-31)
  342.  cp    1
  343.  ret    z    ;you can't go up, there is brick above you
  344.  ld    a,(direction)
  345.  or    a
  346.  jr    nz,upright
  347. upleft:
  348.  ld    a,(ix-1)
  349.  or    a
  350.  ret    z    ;bozo there's nothing to climb:)
  351.  cp    3
  352.  jp    z,nextlevel
  353.  ld    a,(ix-32)
  354.  cp    3
  355.  jp    z,nextlevel
  356.  or    a
  357.  ret    nz    ;its too tall
  358.  ld    a,(carry)
  359.  or    a
  360.  jr    z,upleft2
  361.  ld    a,(ix-63)
  362.  or    a
  363.  ret    nz    ;there is something on top of the empty space you're trying to move into
  364.  ld    (ix-31),a ;erase current block carried 
  365.  ld    (ix-63),2 ;put up where you will be
  366. upleft2:
  367.  ld    (ix),a
  368.  ld    de,-32
  369.  add    ix,de
  370.  ld    (ix),4
  371.  ld    (guyloc),ix
  372.  xor    a
  373.  ld    (direction),a
  374.  call    checkleft
  375.  call    checkup
  376.  jp    dispall
  377. upright:
  378.  ld    a,(ix+1)
  379.  or    a
  380.  ret    z    ;bozo there's nothing to climb:)
  381.  cp    3
  382.  jp    z,nextlevel
  383.  ld    a,(ix-30)
  384.  cp    3
  385.  jp    z,nextlevel
  386.  or    a
  387.  ret    nz    ;its too tall
  388.  ld    a,(carry)
  389.  or    a
  390.  jr    z,upright2
  391.  ld    a,(ix-61)
  392.  or    a
  393.  ret    nz
  394.  ld    (ix-31),a
  395.  ld    (ix-61),2
  396. upright2:
  397.  ld    (ix),a
  398.  ld    de,-30
  399.  add    ix,de
  400.  ld    (ix),5
  401.  ld    (guyloc),ix
  402.  ld    a,1
  403.  ld    (direction),a
  404.  call    checkright
  405.  call    checkup
  406.  jp    dispall
  407.  
  408. down:    ;pick up/put down
  409.  ld    ix,(guyloc)
  410.  ld    a,(carry)
  411.  or    a
  412.  jr    nz,putdown
  413.  ld    a,(ix-31)
  414.  or    a
  415.  ret    nz    ;there is something over your head
  416.  ld    a,(direction)
  417.  or    a
  418.  jr    nz,pickupr 
  419.  ld    a,(ix-1)
  420.  cp    2
  421.  ret    nz    ;yes you're still stupid, you can't pick it up(if there was anything there in the first place)
  422.  ld    a,(ix-32)
  423.  or    a
  424.  ret    nz    ;can't pick up something if something is on top of it
  425.  ld    a,2
  426.  ld    (carry),a
  427.  ld    (ix-1),0
  428.  ld    (ix-31),a
  429.  call    dispall
  430. ; ld    c,1
  431.  jp    nodkey
  432. pickupr:
  433.  ld    a,(ix+1)
  434.  cp    2
  435.  ret    nz    ;yes you're still stupid, you can't pick it up(if there was anything there in the first place)
  436.  ld    a,(ix-30)
  437.  or    a
  438.  ret    nz    ;can't pick up something if something is on top of it
  439.  ld    (ix+1),a
  440.  ld    a,2
  441.  ld    (carry),a
  442.  ld    (ix-31),a
  443.  call    dispall
  444.  jp    nodkey
  445. putdown:
  446.  ld    a,(direction)
  447.  rla
  448.  ld    e,a
  449.  ld    d,0
  450.  dec    de
  451.  add    ix,de    ;either ix-1 or ix+1
  452.  ld    de,-31
  453.  add    ix,de    ;now we have the blocks location left or right one
  454.  ld    a,(ix)
  455.  or    a
  456.  ret    nz    ;something is in the way
  457. putdown2:
  458.  ld    de,31
  459.  add    ix,de
  460.  ld    a,(ix)
  461.  or    a
  462.  jr    z,putdown2
  463. putdown3:
  464.  ld    (ix-31),2
  465.  ld    ix,(guyloc)
  466.  xor    a
  467.  ld    (ix-31),a
  468.  ld    (carry),a
  469.  call    dispall
  470.  jp    nodkey
  471. checkup:
  472.  ld    a,(my)
  473.  cp    40
  474.  ret    nc
  475. checkup2:
  476.  ld    hl,(toploc)
  477.  ld    de,-31
  478.  add    hl,de
  479.  ld    a,(hl)
  480.  inc    a
  481.  ret    z
  482.  ld    (toploc),hl
  483.  ret
  484. checkdown:
  485.  ld    a,(my)
  486.  cp    24
  487.  ret    c
  488. checkdown2:
  489.  ld    hl,(toploc)
  490.  ld    de,248
  491.  add    hl,de
  492.  ld    a,(hl)
  493.  inc    a
  494.  ret    z
  495.  ld    de,-217
  496.  add    hl,de
  497.  ld    (toploc),hl
  498.  ret
  499. checkright:
  500.  ld    a,(mx)
  501.  cp    72
  502.  ret    c
  503. checkright2:
  504.  ld    ix,(toploc)
  505.  ld    a,(ix+16)
  506.  inc    a
  507.  ret    z
  508.  inc    ix
  509.  ld    (toploc),ix
  510.  ret
  511. checkleft:
  512.  ld    a,(mx)
  513.  cp    64
  514.  ret    nc
  515. checkleft2:
  516.  ld    ix,(toploc)
  517.  dec    ix
  518.  ld    a,(ix)
  519.  inc    a
  520.  ret    z
  521.  ld    (toploc),ix
  522.  ret
  523. checkfall:
  524.  ld    ix,(guyloc)
  525.  ld    a,(ix+31)
  526.  or    a
  527.  jr    nz,checkfall3
  528.  ld    a,(my)
  529.  add    a,8
  530.  ld    (my),a
  531.  call    checkdown
  532.  ld    (ix),0
  533.  ld    de,31
  534.  add    ix,de
  535.  ld    a,(direction)
  536.  add    a,4
  537.  ld    (ix),a
  538.  ld    (guyloc),ix
  539.  ld    a,(carry)
  540.  or    a
  541.  jr    z,checkfall2
  542.  ld    (ix-31),a    ;i think it'll always be 2
  543.  ld    (ix-62),0
  544. checkfall2:
  545.  jr    checkfall
  546. checkfall3:
  547.  cp    3
  548.  ret    nz
  549.  call    dispall
  550.  pop    hl        ;de increment stack by 2
  551.  jp    nextlevel
  552.  
  553. dispall:
  554.  call    erasescreen
  555.  call    drawtiles
  556. delay:    ;or nokey
  557.  call _grbufcpy_v
  558.  ld    c,12
  559. delay2:
  560.  halt
  561.  ld    b,0FEh
  562.  call    Direct_Input
  563.  inc    a
  564.  jr    z,delay3
  565.  dec    c
  566.  jr    nz,delay2
  567. delay3:
  568.  ret
  569.  
  570.  
  571. getdata2:
  572.  push    bc
  573.  push    hl
  574.  push    de
  575.  push    ix
  576.  ld    c,0
  577. getdata3:
  578.  ld    hl,(curloc)
  579.  ld    a,(mask)
  580.  ld    b,a
  581.  ld    a,(hl)
  582.  and    b
  583.  cp    b
  584.  jr    nz,gotbyte
  585.  inc    c
  586.  call    nec
  587.  jr    getdata3
  588. gotbyte:
  589.  call    nec
  590.  ld    a,c
  591.  pop    ix
  592.  pop    de
  593.  pop    hl
  594.  pop    bc
  595.  ret
  596. nec:
  597.  ld    a,(mask)
  598.  rrca
  599.  ld    (mask),a
  600.  cp    128
  601.  ret    nz
  602.  inc    hl
  603.  ld    (curloc),hl
  604.  ret
  605.  
  606. interpret:
  607.  or    a
  608.  ret    z
  609.  ld    ix,brick-8
  610.  ld    de,8
  611. interpret2:
  612.  add    ix,de
  613.  dec    a
  614.  jr    nz,interpret2
  615.  ld    a,(y)
  616.  ld    l,a
  617.  ld    a,(x)
  618. sprite:
  619.  ld     b,8
  620.  jp     smsprt
  621.  
  622. ;draw the tiles on screen from location (toploc)
  623. drawtiles:
  624.  ld    hl,(toploc)
  625.  xor    a
  626.  ld    (y),a
  627. drawtiles2:
  628.  xor    a
  629.  ld    (x),a
  630. drawtiles3:
  631.  ld    a,(hl)
  632.  cp    4
  633.  jr    c,drawtiles4
  634.  ld    (guyloc),hl
  635.  sub    4
  636.  ld    (direction),a
  637.  ld    de,(x)
  638.  ld    (mx),de
  639.  add    a,4
  640. drawtiles4:
  641.  push    hl
  642.  call    interpret
  643.  pop    hl
  644.  inc    hl
  645.  ld    a,(x)
  646.  add    a,8
  647.  ld    (x),a
  648.  cp    128
  649.  jr    nz,drawtiles3
  650.  ld    de,15
  651.  add    hl,de
  652.  ld    a,(y)
  653.  add    a,8
  654.  ld    (y),a
  655.  cp    64
  656.  jr    nz,drawtiles2
  657.  ret
  658. erasescreen:
  659.  ld    bc,1023
  660.  ld    hl,plotsscreen
  661.  ld    (hl),0
  662.  ld    de,plotsscreen+1
  663.  ld    a,(mode)
  664.  or    a
  665.  jr    nz,part
  666.  ldir
  667.  ret
  668. part:
  669.  ldir
  670.  ld    HL,titlescreen
  671.  ld    DE,plotsscreen
  672.  call    DispRLE
  673.  ret
  674. get2nd:
  675.  call    get_key
  676.  cp    $36
  677.  jr    nz,get2nd
  678.  ret
  679. nodkey:
  680.  ld    c,1    ;mask for nokey
  681. nokey:
  682.  push    bc
  683.  call _grbufcpy_v
  684.  pop    bc
  685. nokey2:
  686.  halt
  687.  ld    b,0FEh
  688.  call    Direct_Input
  689.  and    c
  690.  cp    c
  691.  jr    nz,nokey2
  692.  ret
  693.  
  694. nextlevel:
  695.  ld    a,(mode)
  696.  or    a
  697.  jr    nz,loaddemo
  698.  pop    hl    ;de increment stack by 2
  699.  jp    setuplevel
  700.  
  701. loaddemo:
  702.  ld    a,1
  703.  ld    (mode),a
  704.  ld    a,100
  705.  ld    (counter),a
  706.  ld    hl,level1+3    ;beginning of compressed data (skipping the password
  707.  ld    (curloc),hl
  708.  call    erasemap
  709.  ld    a,128
  710.  ld    (mask),a
  711.  ld    hl,moves
  712.  ld    (curloc),hl
  713.  ret
  714. ;-----Menu Routine------;
  715. ;as it is now, this is    ;
  716. ;a sideways menu routine;
  717. ;to move use right and    ;
  718. ;left. Use del to select;
  719. ;an option        ;
  720. ;required vars:        ;
  721. ;textloc     ;2 bytes;
  722. ;textxy        ;2 bytes;
  723. ;option        ;1 byte    ;
  724. ;options    ;1 byte    ;
  725. ;be sure to put option    ; 
  726. ;right before the the     ;
  727. ;var options in memory    ;
  728. ;            ;
  729. ;input for menu:    ;
  730. ;hl=start of text    ;
  731. ;de=coors of menu    ;
  732. ;a=options        ;
  733. ;            ;
  734. ;output:        ;
  735. ;option= # of options-1st or 2nd or...;
  736. ;--------Code-----------;
  737. choosemode:        ;
  738.  ld    (textloc),hl    ;store the variables
  739.  ld    (textxy),de    ;
  740.  ld    (options),a    ;
  741.  ld    (option),a    ;a=the num of options. If there were 5 then five would point to the first option 
  742. writemenu:        
  743.  ld    hl,(textloc)
  744.  ld    de,(textxy)
  745.  ld    (pencol),de
  746.  ld    a,(options)    ;load a and b with the 
  747.  ld    b,a        ;number of option
  748. writemenu2:        ;
  749.  push    bc        ;save bc
  750.  ld    a,(option)    ;see if option(the one that sould be highlighted)
  751.  cp    b        ;= b(the current option being written
  752.  jr    nz,ivputs    ;
  753.  set    textInverse,(iy+textflags);
  754.  call    _vputs        ;
  755.  res    textInverse,(iy+textflags);
  756.  
  757. writemenu3:        ;
  758.  pop    bc        ;recall bc
  759.  djnz    writemenu2    ;
  760.  
  761. writemenu4:        ;main loop for selecting
  762.  ld    a,(mode)
  763.  or    a
  764.  jr    z,men5
  765.  call    demomode
  766.  call _grbufcpy_v
  767. men5:
  768.  call   get_key        ;
  769.  cp     $36        ;2nd?
  770.  ret    z
  771.  cp    $02        ;left?
  772.  jr    z,leftmen    ;then move left
  773.  cp    $03        ;right?
  774.  jr    z,rightmen    ;then move right
  775.  cp    $30
  776.  jr    nz,writemenu4
  777.  ld    a,(mode)
  778.  or    a
  779.  jr    z,writemenu4
  780.  ld    a,(option)
  781.  dec    a
  782.  ld    hl,secbuf
  783.  ld    d,0
  784.  ld    e,a
  785.  add    hl,de
  786.  ld    (hl),1
  787.  ld    hl,secbuf
  788.  ld    b,4
  789. secloop:
  790.  ld    a,(hl)
  791.  dec    a
  792.  jr    nz,writemenu4
  793.  inc    hl
  794.  djnz    secloop
  795.  jp    secretselect
  796.  
  797. leftmen:        ;move left in the menu
  798.  ld    de,(option)    ;compare 
  799.  ld    a,e        ;option to
  800.  cp    d        ;options
  801.  jr    z,writemenu4    ;if = then go back
  802.  inc    a        ;increase the option pointer
  803.  ld    (option),a    ;
  804.  jr    writemenu    ;rewrite the menu
  805. rightmen:        ;
  806.  ld    a,(option)    ;compare 
  807.  cp    1        ;option # to 1
  808.  jr    z,writemenu4    ;if = then go back
  809.  dec    a        ;else decrease the option #
  810.  ld    (option),a    ;
  811.  jr    writemenu    ;rewrite menu
  812. ivputs:            ;text w/ underline
  813.  call    _vputs        ;
  814.  jr    writemenu3    ;
  815. ;-----------------------;
  816. secretselect:
  817.  xor    a
  818.  ld    (mode),a
  819.  call    box
  820.  ld    hl,select
  821.  ld    de,256*24+43
  822.  ld    (pencol),de
  823.  call    _vputs
  824.  ld    de,256*31+54
  825.  ld    (pencol),de
  826.  call    _vputs
  827. ; call _grbufcpy_v
  828.  ld    a,1
  829.  ld    (level),a
  830. secretloop:
  831.  ld    de,256*38+63
  832.  ld    (pencol),de
  833.  ld    hl,blanks
  834.  call    _vputs
  835.  ld    de,256*38+60
  836.  ld    (pencol),de
  837.  ld    a,(level)
  838.  ld    h,0
  839.  ld    l,a
  840.  call    disphl
  841. ; call _grbufcpy_v
  842. secretl2:
  843.  call    get_key
  844.  cp    $04
  845.  jr    z,sup
  846.  cp    $01
  847.  jr    z,sdown
  848.  cp    $36
  849.  jr    z,secl3
  850.  jr    secretl2
  851. sup:
  852.  ld    a,(level)
  853.  dec    a
  854.  jr    z,secretl2
  855.  ld    (level),a
  856.  jr    secretloop
  857. sdown:
  858.  ld    a,(level)
  859.  cp    11
  860.  jr    z,secretl2
  861.  inc    a
  862.  ld    (level),a
  863.  jr    secretloop
  864. secl3:
  865.  ld    hl,level1-1
  866.  ld    (curloc),hl
  867.  ld    a,(level)
  868.  ld    b,a
  869. secl4:
  870.  ld    hl,(curloc)
  871.  ld    (levloc),hl
  872.  ld    de,4
  873.  add    hl,de
  874.  ld    (curloc),hl
  875.  push    bc
  876.  call    erasemap
  877.  pop    bc
  878.  djnz    secl4
  879.  pop    hl    ;rid ourselves of a call
  880.  jp    restart
  881. erasemap:
  882.  ld    hl,boardmap
  883.  ld    (hl),$ff
  884.  ld    de,boardmap+1
  885.  ld    bc,650
  886.  ldir
  887.  call    erasescreen
  888.  ld    a,128
  889.  ld    (mask),a
  890. copydata:
  891.  ld    hl,(curloc)
  892.  ld    a,(hl)
  893.  ld    e,a
  894.  inc    hl
  895.  ld    a,(hl)
  896.  ld    d,a
  897.  inc    hl
  898.  ld    (toploc),de
  899.  ld    a,(hl)
  900.  ld    (height),a
  901.  inc    hl
  902.  ld    a,(hl)
  903.  ld    (width),a
  904.  inc    hl
  905.  ld    (curloc),hl
  906.  ld    hl,boardmap+32
  907. copydata2:
  908.  ld    a,(width)
  909.  ld    b,a
  910. copydata3:
  911.  call    getdata2
  912.  ld    (hl),a
  913.  inc    hl
  914.  djnz    copydata3
  915.  ld    a,(width)
  916.  ld    b,a
  917.  ld    a,31
  918.  sub    b
  919.  ld    d,0
  920.  ld    e,a
  921.  add    hl,de
  922.  ld    a,(height)
  923.  dec    a
  924.  ld    (height),a
  925.  jr    nz,copydata2
  926.  xor    a
  927.  ld    (carry),a
  928.  jp    drawtiles
  929. demomode:
  930.  ld    hl,counter
  931.  dec    (hl)
  932.  ret    nz
  933.  ld    (hl),100
  934.  call    getdata2
  935.  cp    1
  936.  jp    z,up
  937.  cp    2
  938.  jp    z,right
  939.  cp    3
  940.  jp    z,down
  941.  cp    4
  942.  jp    z,left
  943.  ret
  944. ;===========================================================
  945. ; RLE picture displayer v1.1
  946. ; Decodes a RLE picture made by RLE2PIC
  947. ; 82/83 version
  948. ;
  949. ; written by David Phillips <electrum@tfs.net>
  950. ; started: 8/19/98
  951. ; last update: 1/12/98
  952. ;
  953. ; input: HL = RLE encoded picture, DE = where to display
  954. ; output: 1024 byte decoded picture
  955. ; destroys: AF, BC, DE, HL
  956. ; current size: 32 bytes
  957. ;===========================================================
  958. DispRLE:
  959.  ld bc,352            ; we need to copy 768 bytes
  960. DispRLEL:
  961.  ld a,(hl)            ; get the next byte
  962.  cp $91                ; is it a run?
  963.  jr z,DispRLERun    ; then we need to decode the run
  964.  ldi                ; copy the byte, and update counters
  965. DispRLEC:
  966.  ld a,b                ; check the low byte and
  967.  or c                ; the high byte for 0
  968.  jr nz,DispRLEL        ; if not, then we're not done either
  969.  ret                ; if it's zero, we're done
  970. DispRLERun:
  971.  inc hl                ; move to the run value
  972.  ld a,(hl)            ; get the run value
  973.  inc hl                ; move to the run count
  974.  push hl            ; save source pointer
  975.  ld h,(hl)            ; get the run count
  976.  ex de,hl            ; swap source and destination pointers
  977. DispRLERunL:
  978.  ld (hl),a            ; copy the byte
  979.  inc hl                ; increase destination pointer
  980.  dec bc                ; decrease byte count
  981.  dec d                ; decrease run count
  982.  jr nz,DispRLERunL    ; if we're not done, then loop
  983.  ex de,hl            ; swap pointers back
  984.  pop hl                ; recover source pointer
  985.  inc hl                ; advance the source pointer
  986.  jr DispRLEC        ; check to see if we should loop
  987.  
  988. box:                ; START OF CODE By Chris Hiszpanski (Man in the Moon)
  989.  ld    a,31            ; Height + 1 again
  990.  ld    de,plotsscreen+261        ; Top left corner
  991. clearline:            ; Clear the section saved
  992.  ld    hl,byte
  993.  ld    bc,6            ;
  994.  ldir                ;
  995.  inc    de            ; Skip last 8 bytes
  996.  inc    de            ;
  997.  inc    de            ; Skip last 8 bytes
  998.  inc    de            ;
  999.  inc    de            ;
  1000.  inc    de            ;
  1001.  inc    de            ; Skip last 8 bytes
  1002.  inc    de            ;
  1003.  inc    de            ;
  1004.  inc    de            ;
  1005.  dec    a            ;
  1006.  or    a            ;
  1007.  jr    nz,clearline        ;
  1008.  
  1009. line:
  1010.  ld    hl,graph_mem+261        ; Top left corner
  1011.  ld    a,255
  1012.  ld    b,6
  1013. line1:
  1014.  ld    (hl),a
  1015.  inc    hl
  1016.  djnz    line1
  1017.  ld    hl,graph_mem+741
  1018.  ld    b,6
  1019. line2:
  1020.  ld    (hl),a
  1021.  inc    hl
  1022.  djnz    line2
  1023.  ld    a,%10000000
  1024.  ld    hl,graph_mem+277
  1025.  ld    de,16
  1026.  ld    b,29
  1027. line3:
  1028.  ld    (hl),a
  1029.  add    hl,de
  1030.  djnz    line3
  1031.  ld    a,%00000001
  1032.  ld    hl,graph_mem+282
  1033.  ld    de,16
  1034.  ld    b,29
  1035. line4:
  1036.  ld    (hl),a
  1037.  add    hl,de
  1038.  djnz    line4
  1039.  
  1040.  call _grbufcpy_v
  1041.  
  1042. ;vortexx15
  1043. ;put title in 
  1044.  ld    hl,description
  1045.  ld    de,17*256+41
  1046.  ld    (pencol),de
  1047.  set    textInverse,(iy+textflags)
  1048.  call    _vputs
  1049.  res    textInverse,(iy+textflags)
  1050. ;end of title
  1051. ;/vortexx15
  1052. ;*** needs lines
  1053.  ret
  1054.  
  1055. ;input: hl(to be displayed)
  1056. ;------------------------
  1057. disphl:
  1058.  ld de,-1
  1059.  ld (_curRow),de
  1060.  xor a
  1061.  call 4A33h
  1062.  dec hl
  1063.  jp _vputs
  1064. ;------------------------
  1065. message1:
  1066.  call    box
  1067.  ld    hl,joke
  1068.  ld    de,27*256+44
  1069.  ld    (pencol),de
  1070.  call    _vputs
  1071.  ld    hl,mess1txt
  1072.  ld    de,36*256+43
  1073.  ld    a,2
  1074.  call    choosemode
  1075.  ld    a,(option)
  1076.  dec    a
  1077.  jp    z,prog_start
  1078. ;restart level
  1079. restart:
  1080.  ld    hl,(levloc)
  1081.  ld    (curloc),hl
  1082.  ld    hl,level
  1083.  dec    (hl)
  1084.  jp    setuplevel
  1085.  
  1086. ;input: 
  1087. ;bc= coors
  1088.  
  1089. input:
  1090.  ld    hl,passbuff
  1091.  ld    (passloc),hl
  1092.  ld    (textxy),bc
  1093.  ld    (pencol),bc
  1094.  ld    a,3
  1095.  ld    (option),a
  1096. alphastart:
  1097.  ld    a,'A'
  1098.  ld    (char),a
  1099. placechar:
  1100.  push    af
  1101.  ld    hl,(textxy)
  1102.  push    hl
  1103.  ld    (pencol),hl
  1104.  ld    hl,blanks
  1105.  call    _vputs
  1106.  pop    hl
  1107.  ld    (pencol),hl
  1108.  pop    af
  1109.  call    _vputmap
  1110. inputmain:
  1111.  call   get_key        ;    
  1112.  cp    $04        ;up?
  1113.  jr    z,inputup
  1114.  cp    $01        ;down?
  1115.  jr    z,inputdown
  1116.  cp    $36        ;2nd?    
  1117.  jr    z,nextchar    ;    
  1118.  jr    inputmain
  1119. inputdown:
  1120.  ld    a,(char)
  1121.  cp    'Z'
  1122.  jr    z,inputdown2
  1123.  cp    'z'
  1124.  jr    z,alphastart
  1125.  inc    a
  1126.  ld    (char),a
  1127.  jr    placechar
  1128. inputdown2:
  1129.  ld    a,'a'
  1130.  ld    (char),a
  1131.  jr    placechar
  1132. inputup:
  1133.  ld    a,(char)
  1134.  cp    'A'
  1135.  jr    z,lalphaend
  1136.  cp    'a'
  1137.  jr    z,alphaend
  1138.  dec    a
  1139.  ld    (char),a
  1140.  jr    placechar
  1141. alphaend:
  1142.  ld    a,'Z'
  1143.  ld    (char),a
  1144.  jr    placechar
  1145. lalphaend:
  1146.  ld    a,'z'
  1147.  ld    (char),a
  1148.  jr    placechar
  1149. nextchar:
  1150.  ld    a,(char)
  1151.  ld    hl,(passloc)
  1152.  ld    (hl),a
  1153.  inc    hl
  1154.  ld    (passloc),hl
  1155.  ld    hl,(pencol)
  1156.  ld    (textxy),hl
  1157.  ld    hl,option
  1158.  dec    (hl)
  1159.  ret    z
  1160.  jr    placechar
  1161.  
  1162. brick:
  1163.  .db    %11111011
  1164.  .db    %11111011
  1165.  .db    %00000000
  1166.  .db    %11111110
  1167.  .db    %11111110
  1168.  .db    %00000000
  1169.  .db    %11111011
  1170.  .db    %11111011
  1171. block:            ;varible sized block
  1172.  .db    %11111111
  1173.  .db    %10000001
  1174.  .db    %10000001
  1175.  .db    %10000001
  1176.  .db    %10000001
  1177.  .db    %10000001
  1178.  .db    %10000001
  1179.  .db    %11111111
  1180. door:
  1181.  .db    %01111110
  1182.  .db    %01000010
  1183.  .db    %01000010
  1184.  .db    %01000010
  1185.  .db    %01000110
  1186.  .db    %01000010
  1187.  .db    %01000010
  1188.  .db    %01111110
  1189. manl:
  1190.  .db    %00011100
  1191.  .db    %01111110
  1192.  .db    %00010010
  1193.  .db    %00100010
  1194.  .db    %00010100
  1195.  .db    %00101010
  1196.  .db    %00001000
  1197.  .db    %00110110
  1198. manr:
  1199.  .db    %00111000
  1200.  .db    %01111110
  1201.  .db    %01001000
  1202.  .db    %01000100
  1203.  .db    %00101000
  1204.  .db    %01010100
  1205.  .db    %00010000
  1206.  .db    %01101100
  1207. titlescreen:    ;rle
  1208.  .db $91,$00,$0b,$40,$91,$00,$08,$3f,$b0,$00,$08,$1f,$f0,$00,$40,$91
  1209.  .db $00,$08,$0c,$90,$00,$08,$08,$18,$00,$40,$91,$00,$08,$09,$10,$00
  1210.  .db $10,$08,$08,$00,$40,$91,$00,$08,$16,$20,$e3,$96,$10,$0e,$21,$c6
  1211.  .db $91,$00,$08,$1f,$a3,$2c,$28,$10,$0a,$46,$9a,$91,$00,$08,$20,$a4
  1212.  .db $30,$30,$20,$14,$59,$14,$91,$00,$08,$20,$a4,$50,$50,$20,$24,$91
  1213.  .db $91,$01,$28,$91,$00,$08,$21,$44,$92,$48,$20,$45,$93,$20,$91,$00
  1214.  .db $08,$3e,$47,$1c,$4c,$3f,$86,$5d,$b8,$91,$00,$0b,$40,$00,$00,$01
  1215.  .db $91,$00,$0a,$04,$39,$b1,$06,$4d,$b8,$91,$00,$0a,$0a,$12,$2a,$88
  1216.  .db $aa,$a0,$91,$00,$0a,$0e,$12,$33,$8a,$ea,$b0,$91,$00,$0a,$0a,$12
  1217.  .db $22,$8a,$aa,$a0,$91,$00,$0a,$0a,$11,$a2,$86,$a8,$b8,$91,$00,$1a
  1218.  .db $32,$8a,$4c,$ee,$aa,$4e,$91,$00,$0a,$2a,$8a,$aa,$48,$aa,$c8,$91
  1219.  .db $00,$0a,$31,$0a,$ac,$4c,$44,$4c,$91,$00,$0a,$29,$0a,$aa,$48,$aa
  1220.  .db $42,$91,$00,$0a,$31,$04,$4a,$4e,$aa,$ec,$91,$00,$05
  1221. ; Total compression: 352 bytes compressed to 205 (41% smaller)
  1222.  
  1223. ;levels are compressed huffman meathod
  1224. level1:
  1225.  .db    "tcP"        ;password
  1226.  .dw    boardmap+36    ;screen starting position
  1227.  .db    8    ;height
  1228.  .db    20    ;widht
  1229.  .db    128,0,10,0,0,40,0,0,160,0,2,132,2,2,184,132,201,159,21
  1230.  .db    85,85,85,85,80,0,0,0    ;27 bytes of blocks
  1231.  
  1232. level2:
  1233.  .db    "ARo"
  1234.  .dw    boardmap+100    ;screen starting position
  1235.  .db    10    ;height
  1236.  .db    22    ;widht
  1237.  .db    %01000001,%01000000,%00010100,%00001000,%00000000,%00000010
  1238.  .db    %00010100,%00000000,%00000000,%10001011,%10000000,%00000000
  1239.  .db    %00001001,%01000000,%00000000,%00000010,%01000000,%00000010
  1240.  .db    %00110000,%01001000,%00000000,%01011001,%10110111,%10001001
  1241.  .db    %01010101,%00001010,%10101010,%10101010,%10101000,%00010001
  1242.  .db    %10100000,%00000000,%00000101,%01010100,%00000000,%00000000
  1243. ;36 bytes of blocks
  1244. level3:
  1245.  .db    "CKs"
  1246.  .dw    boardmap+95
  1247.  .db    11    ;height
  1248.  .db    19    ;width
  1249.  .db    %01000000,%00000000,%00000100,%00101010,%10101010,%10101010
  1250.  .db    %10100100,%10010000,%00000000,%00101000,%10000000,%00000000
  1251.  .db    %10100000,%00000000,%00001101,%01000000,%00000000,%00110110
  1252.  .db    %10100101,%01000001,%11100001,%01100101,%00100100,%10000010
  1253.  .db    %00101010,%10100010,%01001011,%01100101,%00010000,%00010111
  1254.  .db    %01001010,%10101010,%01010000,%00010101,%00101000,%01010100
  1255.  .db    %00000000
  1256. level4:
  1257.  .db    "daN"
  1258.  .dw    boardmap+195
  1259.  .db    16
  1260.  .db    24
  1261.  .db    %00000000,%00000000,%00100000,%00000000,%00000000,%00100100,%00000000,%00100000
  1262.  .db    %00001000,%01000000,%00001001,%00000001,%00000010,%00000101,%01000010,%00001000
  1263.  .db    %00000100,%00100000,%00010001,%00000000,%00100100,%00000000,%10100000,%00000010
  1264.  .db    %01000000,%00000000,%00000001,%10100100,%00000000,%00000000,%00110110,%10010000
  1265.  .db    %00000000,%00001111,%00001010,%10101000,%00100000,%00000010,%00010001,%01110000
  1266.  .db    %01001100,%00000001,%01010101,%00010101,%01010010,%01100001,%10001010,%10000000
  1267.  .db    %00001001,%00110010,%01011001,%00000000,%00000100,%10101010,%10101010,%10100000
  1268.  .db    %00000000,%10101000,%00000000,%0000000
  1269. level5:
  1270.  .db    "BAH"
  1271.  .dw    boardmap+161
  1272.  .db    14
  1273.  .db    22
  1274.  .db    %00000101,%01000001,%01010101,%01010101,%00010101,%01000010,%10101000,%00000001
  1275.  .db    %01000000,%00000000,%00000001,%01000000,%00000000,%00000001,%01000000,%00000000
  1276.  .db    %00000001,%01000000,%10000000,%00000000,%10100000,%01000000,%00000000,%01010000
  1277.  .db    %00101101,%10110110,%00000000,%00101011,%10000101,%01010101,%01011110,%00000000
  1278.  .db    %10101001,%01010000,%00101001,%00000011,%01001001,%00000000,%01001010,%00011011
  1279.  .db    %01001001,%00000000,%01001010,%00110110,%11010010,%10100000,%00001001,%01010101
  1280.  .db    %01010100,%00000000,%00010101,%00000000,%0
  1281. level6:
  1282.  .db    "Ion"
  1283.  .dw    boardmap+130
  1284.  .db    13
  1285.  .db    21
  1286.  .db    %01010100,%00000000,%00001010,%10100100,%01010101,%01010101,%01010101,%01000010
  1287.  .db    %10100000,%00000000,%00000010,%10111000,%00000000,%00000000,%10101000,%00000000
  1288.  .db    %00000000,%10010000,%00000000,%00000110,%11010010,%11011000,%00000010,%00110001
  1289.  .db    %01010010,%11011011,%00000000,%10111101,%10110110,%01000010,%11011011,%01100000
  1290.  .db    %00101010,%10100100,%00101010,%10100000,%10101000,%01010100,%00000010,%00011010
  1291.  .db    %00000000,%00000001,%01001010,%10000000,%00000000,%00101010,%00000000,%0000
  1292. level7:
  1293.  .db    "Twe"
  1294.  .dw    boardmap+195
  1295.  .db    14
  1296.  .db    24
  1297.  .db    %00100001,%01010101,%00001010,%00010101,%00001001,%00100000,%01001000,%10010000
  1298.  .db    %10001000,%10100000,%00101000,%01010000,%01001000,%01000000,%00100000,%10000010
  1299.  .db    %01000000,%00000000,%00000001,%10100100,%00000000,%00000000,%00011010,%10100000
  1300.  .db    %00000000,%00000001,%10110101,%01110000,%11000000,%00000000,%00101010,%10100001
  1301.  .db    %00110000,%00100000,%10100100,%00100001,%00110000,%01010011,%00111101,%01010100
  1302.  .db    %00101000,%10011011,%01100010,%10011011,%01101000,%00000100,%01010101,%01010010
  1303.  .db    %10101010,%10100000,%00010100,%10000010,%10100000,%00000000,%00101010,%00000000
  1304.  .db    %00000000,%00
  1305. level8:
  1306.  .db    "nTy"
  1307.  .dw    boardmap+322
  1308.  .db    17
  1309.  .db    27
  1310.  .db    %01010100,%00000010,%10101000,%01010101,%01010100,%01000010,%00000100,%00010010
  1311.  .db    %00000001,%00100000,%10000100,%00001010,%00000000,%01010110,%00001010,%10000010
  1312.  .db    %01000000,%10101000,%10101101,%10000000,%00010100,%00000101,%00100010,%10101010
  1313.  .db    %00000001,%01000000,%00000101,%11001000,%01010000,%00000000,%01010000,%01010010
  1314.  .db    %00100000,%11001000,%00001000,%10000000,%10001000,%00110100,%10000010,%00010000
  1315.  .db    %00010010,%00010101,%00001000,%00100010,%00000110,%10010000,%00010010,%00000010
  1316.  .db    %10000001,%10110101,%00000000,%01000000,%00000010,%10101010,%10100000,%00000000
  1317.  .db    %11000000,%00000001,%01000001,%10000000,%10101000,%00000000,%11010100,%00101010
  1318.  .db    %00000000,%00000000,%01101101,%01000000,%00011000,%00000110,%00111100,%01101101
  1319.  .db    %10101010,%10101010,%10101010,%10101010,%10101010,%10101010,%10101010,%10101010
  1320. level9:
  1321.  .db    "iRC"
  1322.  .dw    boardmap+129
  1323.  .db    16
  1324.  .db    20
  1325.  .db    %00000000,%10101000,%00000000,%00000010,%00010000,%00000000,%00010000,%00100010
  1326.  .db    %10101010,%00000100,%00000010,%10000010,%00001000,%00011000,%00000010,%00010000
  1327.  .db    %00011011,%00000001,%10100010,%00000001,%01010000,%01101101,%00100000,%00000000
  1328.  .db    %11110010,%10101010,%00000000,%00000110,%00001010,%11100000,%00000001,%01010000
  1329.  .db    %10101000,%00101000,%01000000,%01101001,%00000101,%01100010,%10000101,%01010010
  1330.  .db    %00001010,%10101010,%10001010,%00001010,%10001000,%00010010,%10000000,%01001010
  1331.  .db    %00000101,%01000000,%00010101,%00000000,%0000000
  1332. level10:
  1333.  .db    "JmK"
  1334.  .dw    boardmap+256
  1335.  .db    19
  1336.  .db    27
  1337.  .db    %00010101,%01010101,%01010101,%01010101,%01010101,%01010000,%01010000,%00000000
  1338.  .db    %10000000,%00010001,%01010101,%10000000,%01101101,%01100001,%10110110,%01101010
  1339.  .db    %01000101,%00010000,%10101010,%10001101,%01010010,%10010100,%00100010,%10000000
  1340.  .db    %00101010,%01010100,%01010000,%10100010,%10110110,%11011000,%00000000,%00101011
  1341.  .db    %10000000,%01010101,%01010100,%00000000,%01010100,%00000001,%00001010,%10000000
  1342.  .db    %00101001,%00000011,%00001001,%00010100,%00000001,%00100000,%01000001,%00000101
  1343.  .db    %00000000,%10010101,%01000101,%00000000,%00000010,%10101010,%00010101,%01010000
  1344.  .db    %00011110,%00000000,%00010000,%10000000,%00001000,%00000000,%01000010,%00000000
  1345.  .db    %01010000,%01010101,%01010101,%00001000,%00000010,%10000000,%00000100,%00010000
  1346.  .db    %00000001,%10000000,%00011010,%00001011,%00000101,%01010101,%01010101,%01000011
  1347.  .db    %01101000,%00101101,%10001010,%00000000,%01010011,%01101101,%00000101,%01010101
  1348.  .db    %00000000,%00001010,%10101010,%0
  1349. level11:
  1350.  .db    "wTF"
  1351.  .dw    boardmap+39
  1352.  .db    19
  1353.  .db    29
  1354.  .db    %10101010,%10101010,%10101010,%10101010,%10101010,%10101010,%10101010,%10100010
  1355.  .db    %00010000,%00000000,%00000000,%01010000,%00110101,%10110000,%00000000,%01010101
  1356.  .db    %01001010,%11000010,%10100110,%10100000,%01100010,%10001110,%01001010,%11011000
  1357.  .db    %00101010,%00011110,%00110000,%00001001,%00101010,%10001101,%10100000,%01001100
  1358.  .db    %00000000,%01001010,%00010101,%01000000,%01000101,%01000010,%10100010,%10110000
  1359.  .db    %00000000,%01001000,%00001000,%11001010,%11011000,%00000101,%01001001,%01100000
  1360.  .db    %10001010,%10101010,%10100110,%00010101,%00010010,%10110001,%00110010,%00101000
  1361.  .db    %00000000,%01100101,%01000110,%10000100,%00101000,%01100000,%01101100,%10000101
  1362.  .db    %01010000,%00001010,%00001010,%10101010,%10101000,%00000010,%10101010,%01010000
  1363.  .db    %00000000,%00011000,%01101010,%00001001,%01010101,%00000000,%00001100,%00100000
  1364.  .db    %11011010,%01010110,%10100001,%00000100,%00000000,%01010101,%00101010,%11010101
  1365.  .db    %00100000,%10000110,%11011001,%10000000,%01010110,%10110101,%10101000,%00100000
  1366.  .db    %00001101,%10110000,%01010101,%01010101,%01010101,%01010101,%01010101,%01010101
  1367.  .db    %01010101,%01010000
  1368.  
  1369. moves:    ;for demo are compressed huffman style
  1370.  .db    %11110111,%01111011,%10101011,%11010111,%10101101,%01101111
  1371.  .db    %01110111,%10111101,%01111011,%11011101,%01011110,%11110111
  1372.  .db    %10000000
  1373. instructions:
  1374.  .db    "The object of this game is",0
  1375.  .db    "to reach the door in each",0
  1376.  .db    "level.  If you are unsure",0
  1377.  .db    "where it is you can hold 2nd",0
  1378.  .db    "down and use the arrow keys",0
  1379.  .db    "to scroll freely.  You can",0
  1380.  .db    "only clinb one block at a time",0
  1381.  .db    "and lift only one block at a",0
  1382.  .db    "time.  To lift up a block",0
  1383.  .db    "press down.  To set it down",0
  1384.  .db    "press down again.  CLEAR will",0
  1385.  .db    "give you the choice of",0
  1386.  .db    "restarting or quiting.  There",0
  1387.  .db    "are 11 levels in this game.",0
  1388.  .db    "Please visit our web page at",0
  1389.  .db    "tcpa.calc.org for additional",0
  1390.  .db    "information.  Thanks to all",0
  1391.  .db    "the beta testers and the ACZ",0
  1392.  .db    "for all there useful utilities",0
  1393.  .db    " ",0
  1394.  
  1395. endtxt:
  1396.  .db    " New ",0," Password ",0," Help ",0," Quit ",0
  1397. mess1txt:
  1398.  .db    " Restart ",0," Quit ",0
  1399. leveltxt:
  1400.  .db    "Level: ",0
  1401. passtxt:
  1402.  .db    "Pass: ",0
  1403. please:
  1404.  .db    "Please Enter",0
  1405.  .db    "The Password",0 
  1406. joke:
  1407.  .db    "Too hard? :)",0
  1408. select:
  1409.  .db    "Secret Level",0
  1410.  .db    "Select",0
  1411. description:
  1412.  .db    "     Block Dude     ",0
  1413. blanks:
  1414.  .db    "        ",0
  1415. smsprt
  1416.     ld    h,$00
  1417.     ld    d,h
  1418.     add    hl,hl
  1419.     add    hl,hl
  1420.     add    hl,hl
  1421.     add    hl,hl
  1422.     ld    e,a
  1423.     and    $07
  1424.     ld    c,a
  1425.     srl    e
  1426.     srl    e
  1427.     srl    e
  1428.     add    hl,de
  1429.     ld    de,vidmem
  1430.     add    hl,de
  1431. sl1:    ld    d,(ix)
  1432.     ld    e,$00
  1433.     ld    a,c
  1434.     or    a
  1435.     jr    z,sl3
  1436. sl2:    srl    d
  1437.     rr    e
  1438.     dec    a
  1439.     jr    nz,sl2
  1440. sl3:    ld    a,(hl)
  1441.     xor    d
  1442.     ld    (hl),a
  1443.     inc    hl
  1444.     ld    a,(hl)
  1445.     xor    e
  1446.     ld    (hl),a
  1447.     ld    de,15
  1448.     add    hl,de
  1449.     inc    ix
  1450.     djnz    sl1
  1451.     ret
  1452. _grbufcpy_v:
  1453.  ld    bc,900
  1454.  ld    a,(mode)
  1455.  or    a
  1456.  jr    nz,gcopy
  1457.  ld bc,1024
  1458. gcopy:
  1459.  ld de,$fc00
  1460.  ld hl,$9000
  1461.  ldir
  1462.  ret
  1463. message2: 
  1464.  call    box
  1465.  ld    hl,endmess
  1466.  ld    de,24*256+48
  1467.  ld    (pencol),de
  1468.  call    _vputs
  1469.  ld    de,30*256+45
  1470.  ld    (pencol),de
  1471.  call    _vputs
  1472.  ld    de,36*256+47
  1473.  ld    (pencol),de
  1474.  call    _vputs
  1475.  call    get2nd
  1476.  jp    prog_start
  1477. endmess:
  1478.  .db    "Well done!",0
  1479.  .db    "You beat all",0 
  1480.  .db    "the levels.",0
  1481. END