home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 82 / asm / source / crash / bm82.asm next >
Encoding:
Assembly Source File  |  2001-07-01  |  30.3 KB  |  1,492 lines

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