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

  1. ;************************************************************************
  2. ;*BBB   L     00    CC   K  K  EEE  DD      III  N   N   Version  1.3   *
  3. ;*B  B  L    0  0  C  C  K K   E    D D      I   NN  N      9/4/99      *
  4. ;*BBB   L    0  0  C     KK    EE   D  D     I   N N N                  *
  5. ;*B  B  L    0  0  C     K K   E    D  D     I   N  NN                  *
  6. ;*BBB   LLL   00    CCC  K  K  EEE  DDD     III  N   N  By Levi Lansing *
  7. ;************************************************************************
  8. ;
  9. ;--Best if viewed and compiled in Asm Studio 86 (http//www.stupidzone.com) 
  10. ;--Use two space tab stops to line everything up (no variable width fonts!)
  11. ;--If it still looks bad, it's because I used Ti86pc as my font! (if you don't
  12. ;  have it, you can get it from Ti-Graph Link 86 (aka winlink).  I like the font a lot.
  13. ;
  14. ;email me - puzzlesome@hotmail.com
  15. ;        I'll gladly help you if you have any questions
  16. ;visit my website - http://www.crosswinds.net/~levisti86/  -dedicated to ASM!
  17. ;
  18. ;by the way, the star of the game is Bob (the little guy you navigate)
  19.  
  20.  
  21.  
  22.  
  23. #include "asm86.h"
  24. #include "ti86asm.inc"
  25.  
  26.  
  27. _getcode        .equ        4068h            ;1000's of clocks faster than _getky (AKA GET_KEY).
  28.  
  29. _cphlde            .equ        403Ch            ;compares hl to de
  30. _ldhlz          .equ        437Bh            ;loads b amount of zeros into data pointed to by hl
  31.  
  32.  
  33. ;The _plotSScreen is where the stuff on the graph is stored.
  34. ;It is located at C9FAh to CDF9h (1024 bytes).
  35. ;The following variables use this area to store temporary data-
  36.  
  37. Temp_Level        =        _plotSScreen            ;C9FAh
  38. Blank                    =        _plotSScreen+20        ;CA0Eh
  39. Temp_Block_L    =        _plotSScreen+28        ;CA16h
  40. Temp_Block        =        _plotSScreen+52        ;CA2Eh
  41. BobX                    =        _plotSScreen+60        ;CA36h
  42. BobY                    =        _plotSScreen+61        ;CA37h
  43. Time_Delay        =        _plotSScreen+62        ;CA38h
  44. Level                    =        _plotSScreen+63        ;CA39h
  45. Timer                    =        _plotSScreen+65        ;CA3Bh
  46. Score                    =        _plotSScreen+67        ;CA3Dh
  47. Bonus                    =        _plotSScreen+69        ;CA3Fh
  48. CurSkill            =        _plotSScreen+71        ;CA41h
  49. VPTEMP                =        _plotSScreen+72        ;CA42h
  50.  
  51.  
  52. .org _asm_exec_ram            ;Loads the Pragram into RAM and runs it
  53.  
  54.     nop                                                                                ;\
  55.     jp Start1                                                                    ; \
  56. .dw $0000                                                                        ;  \Ashell
  57. .dw Title                                                                        ;  /stuff
  58. Title:                                                                            ; /
  59.     .db "Blocked  In  ver 1.3",0                            ;/
  60.  
  61.  
  62. Start1:
  63.  im 1          ;This is where we fix the down-left freeze (and 5 other combos)
  64.  ld hl,$D400   ;I didn't make this code and don;t know how it works
  65.  ld de,$D401
  66.  ld bc,$0100
  67.  ld (hl),$D3
  68.  ldir
  69.  ld hl,int_handler
  70.  ld de,$D3D3
  71.  ld bc,int_end-int_handler
  72.  ldir
  73.  ld a,$D4
  74.  ld i,a
  75.  im 2
  76.  jr donepatch
  77.  
  78. int_handler:
  79.  ex af,af'
  80.  ld a,($C1B4)   ;_CXCURAPP
  81.  cp $1D
  82.  jr c,int_ok
  83.  cp $20
  84.  jr nc,int_ok
  85.  im 1
  86.  jp $0039
  87. int_ok:
  88.  in a,($03)
  89.  bit 3,a
  90.  jp z,$0039
  91.  res 0,a
  92.  out ($03),a
  93.  jp $0039
  94. int_end:
  95. donepatch:  ;We have just fixed it!
  96.  
  97.     call _flushallmenus                            ;Exits all menus in the OS
  98.     call _runindicoff                                ;turns the stupid run indicator off
  99.  
  100.     ld a,($C008)    ;load contrast value
  101.     cp 31                    ;check if the contrast is at max
  102.     jr z,Start        ;if it is, jump to start (don't increase it)
  103.     inc a                    ;increase the contrast
  104.     ld ($C008),a    ;write it back to memory
  105.     out (2),a            ;and to the port
  106.  
  107. Start:
  108.     call _clrScrn                                        ;clears the screen and the text shaddow
  109.     res plotloc,(iy+plotflags)            ;
  110.     res appTextSave,(iy+appflags)        ;keeps the program from writing to the text shaddow
  111.     res appAutoScroll,(iy+appflags)    ;doesn't allow the screen to scroll automatically
  112.     ld hl,_plotSScreen                            ;points hl to the graph shaddow memory
  113.     ld b,76                                                    ;b = 76 bytes
  114.     call _ldhlz                                            ;clears (inserts 0's) into the first 26 bytes of the graph shaddow memory
  115.     set textInverse,(iy+textflags)
  116.     ld de,$0000                                            ;0 -> d , 0 -> e
  117.     ld (_curRow),de                                    ;_curRow = d , _curCol = e
  118.     ld hl,TitleText                                    ;hl points to TitleText
  119.     call _puts                                            ;put TitleText (intro screen)
  120.     res textInverse,(iy+textflags)
  121.     ld de,$FD80                                            ;points de to the middle of the display memory
  122.     ld ix,Written                                        ;points hl to the Written by.. Sprite
  123.     ld de,$0303
  124.     ld b,10                                                    ;bc = 128 bytes
  125. by_Loop:                                                    ;loads bc amount of bytes from hl to de (puts to 128 x 8 sprite)
  126.     call PutSprite
  127.     inc d
  128.     djnz by_Loop
  129.     call Load_New_Level
  130.     ld hl,Intro_Data
  131.     ld de,Temp_Level
  132.     ld bc,20
  133.     ldir
  134.  
  135.  
  136. Menu_Loop:                            ;checks for keys pressed in the intro screen and does stuff when they're pressed
  137.     call Refresh_Background
  138.     call _getcode                        ;check if a key has been pressed without pausing    
  139.     cp K_EXIT                            ;check if it's Exit
  140.     jp z,Exit                            ;jump if it is to Exit
  141.     cp K_F1                                ;check if it's F1
  142.     jp z,Start_Game                ;jp if it is to Start_Game
  143.     cp K_F2                                ;check if it's F2
  144.     jr z,ViewScores                ;jp if it is to ViewScores
  145.     cp K_F3                                ;get the idea....
  146.     jp z,Help
  147.     cp K_F5
  148.     jp z,Exit
  149.     cp K_PLUS
  150.     jr z,Contrast_Up
  151.     cp K_MINUS
  152.     jr z,Contrast_Down
  153.     jr Menu_Loop                    ;jump to Menu_Loop
  154.     
  155. Contrast_Up:
  156.     ld a,($C008)    ;load contrast value
  157.     inc a                    ;increase the contrast
  158.     ld ($C008),a    ;write it back to memory
  159.     out (2),a            ;and to the port
  160.     cp 32
  161.     jr z,Contrast_Down
  162.     jr Menu_Loop
  163.  
  164. Contrast_Down:
  165.     ld a,($C008)    ;load contrast value
  166.     dec a                    ;increase the contrast
  167.     ld ($C008),a    ;write it back to memory
  168.     out (2),a            ;and to the port
  169.     cp 255
  170.     jr z,Contrast_Up
  171.     jr Menu_Loop
  172.  
  173. ViewScores:                                                ;displays the high scores
  174.  
  175.     call _clrScrn                                        ;clear the screen and text shaddow
  176.     call _homeup                                        ;load _curRow & _curCol with 0
  177.     ld hl,HighScoreText                            ;hl points to HighScoreText
  178.     set textInverse,(iy+textflags)    ;turn inverse text on
  179.     call _puts                                            ;put the text
  180.     ld a,(_curRow)                                    ;_curRow -> a
  181.     inc a                                                        ;a+1 -> a
  182.     ld (_curRow),a                                    ;a ->_curRow
  183.     call _puts                                            ;print the next line
  184.     ld a,(_curRow)                                    ;\
  185.     inc a                                                        ; = (_curRow+1 -> _curRow)
  186.     ld (_curRow),a                                    ;/
  187.     call _puts                                            ;print the next line
  188.     ld a,(_curRow)                                    ;\
  189.     inc a                                                        ; = (_curRow+1 -> _curRow)
  190.     ld (_curRow),a                                    ;/
  191.     call _puts                                            ;print the last line
  192.     res textInverse,(iy+textflags)    ;text to normal
  193.     
  194.     ld de,$0002                        ;0 ->d , 2 -> e
  195.     ld (_curRow),de                ;d -> _curRow , e -> _curCol
  196.     ld hl,HighScore                ;hl points to HighScore
  197.     call _puts                        ;put it
  198.     ld hl,(HighScoreE)        ;hl points to HighScoreE (highscore for the easy levels)
  199.     call _putHL                        ;jumps to _putHL until a ret is encountered (_putHL puts the Number in hl)
  200.     ld de,$0004                        ;-- /\
  201.     ld (_curRow),de                ;---||
  202.     ld hl,HighScoreE+2        ;---||
  203.     call _puts                        ;---||
  204.     ld hl,(HighScoreM)        ;---||
  205.     call _putHL                        ;---||
  206.     ld de,$0006                        ;---||
  207.     ld (_curRow),de                ;---||
  208.     ld hl,HighScoreM+2        ;---||
  209.     call _puts                        ;---||
  210.     ld hl,(HighScoreH)        ;---||
  211.     call _putHL                        ;---||
  212. Score_Loop:
  213.     call _getcode                        ;check if a key has been pressed
  214.     cp 0                                    ;check if no key was pressed
  215.     jr z,Score_Loop                ;if no key was pressed, loop
  216.     cp K_CLEAR
  217.     jr z,Clear_Scores
  218.     jp Start                            ;jump to Start
  219.  
  220. Clear_Scores:
  221.     call _clrScrn
  222.     ld hl,Clear?
  223.     ld de,$0002
  224.     ld (_curRow),de
  225.     call _puts
  226.     ld de,$0007
  227.     ld (_curRow),de
  228.     set textInverse,(iy+textflags)
  229.     call _puts
  230.     res textInverse,(iy+textflags)
  231. Clear_Loop:
  232.     call _getcode
  233.     cp K_F1
  234.     jr z,Clear_em
  235.     cp K_F2
  236.     jp z, ViewScores
  237.     jr Clear_Loop
  238.  
  239. Clear_em:
  240.     ld hl,Defaults
  241.     ld de,HighScore
  242.     ld bc,61
  243.     ldir    
  244.     call SaveScore
  245.     jp ViewScores
  246.  
  247.  
  248. Help:                                        ;displays the help text
  249.  
  250.     call _clrScrn                    ;clears the screen and the text shaddow
  251.     ld de,0                                ;0 -> d , 0 -> e
  252.     ld (_penCol),de                ;d -> _penCol , e -> _penRow
  253.     ld hl,HelpText                ;hl points to HelpText
  254.     call _vputs                        ;put the Text in the small font
  255.     ld b,9                                ;9 -> b
  256. Help_Loop:
  257.     ld a,(_penRow)                ;\
  258.     add a,6                                ; - add 6 to _penRow
  259.     ld (_penRow),a                ;/
  260.     ld a,0                                ;\_ load 0 into _penCol
  261.     ld (_penCol),a                ;/
  262.     call _vputs                        ;put the next line in the small font
  263.     djnz Help_Loop                ;decrements b and if it's not 0, jump to Help_Loop
  264. Help_Loop2:
  265.     call _getcode                        ;check if a key has been pressed
  266.     cp 0                                    ;if no key was pressed,
  267.     jp nz,Start                        ;jp to Start
  268.     jr Help_Loop2                    ;if a key was pressed, loop
  269.  
  270.  
  271. Start_Game:                            ;this is where the game beginins
  272.  
  273.     call _clrScrn                    ;clear the screen and the text shaddow
  274.     call _homeup                    ;put the cursor position at 0,0
  275.     ld de,$0002                        ;\_ cursor position to 0,2
  276.     ld (_curRow),de                ;/
  277.     ld hl,Skill_Level            ;hl points to text
  278.     call _puts                        ;put the text (big)
  279.     ld a,(Skill)                    ;Skill -> a
  280.     inc a                                    ;increment a
  281.     ld b,a                                ;a -> b
  282.     ld de,22                            ;22 ->de
  283.  
  284. Skill_Loop:
  285.     add hl,de                            ;point hl 22 (de) bytes ahead of whrer is is currently
  286.     djnz Skill_Loop                ;decrement b and jp if it isn't 0, to Skill_Loop
  287.     sbc hl,de                            ;hl points to far ahead because Skill was incremented to be between 1 & 3,
  288.                                                 ;so, this points hl 22 bytes in the other direction
  289.     ld de,$0007                        ;\_ 0 -> _curRow , 7 -> _curCol
  290.     ld (_curRow),de                ;/
  291.     call _puts                        ;put text in hl on the screen
  292. Start_Game_Loop:
  293.     call _getcode                    ;check if a key was pressed
  294.     cp K_EXIT                            ;if it was Exit
  295.     jp z,Start                        ;jump to Start
  296.     cp K_F1                                ;if it was F1
  297.     jr z,Easy                            ;jump to Easy
  298.     cp K_F3                                ;etc...
  299.     jr z,Medium                        ;etc...
  300.     cp K_F5                                ;etc...
  301.     jr z,Hard                            ;etc...
  302.     jr Start_Game_Loop        ;jump to Start_Game_Loop
  303.  
  304. Easy:
  305.     ld hl,1                                ;0 -> h , 1 -> l
  306.     ld (Level),hl                    ;hl -> Level (Level is two bytes)
  307.     ld a,1                                ;1 -> a
  308.     ld (CurSkill),a                ;1 -> CurSkill
  309.     jr Start_New                    ;jump to Start_New
  310. Medium:
  311.     ld a,(Skill)                    ;skill -> a
  312.     cp 0                                    ;if skill level is 0
  313.     jr z,Start_Game_Loop    ;go back, you can't play the medium levels
  314.     ld hl,11                            ;0 -> h , 11 -> l
  315.     ld (Level),hl                    ;hl -> Level (Level is 2 bytes long)
  316.     ld a,2                                ;2 -> a
  317.     ld (CurSkill),a                ;2 -> CurSkill (so I know which set of levels you're playing)
  318.     jr Start_New                    ;jump to Start_New
  319. Hard:
  320.     ld a,(Skill)                        ;Skill -> a
  321.     cp 2                                        ;check if a = 2
  322.     jr nz,Start_Game_Loop        ;if it doesn't, you're not qualified for the hard levels
  323.     ld hl,21
  324.     ld (Level),hl                        ;21 ->Level
  325.     ld a,3
  326.     ld (CurSkill),a                    ;3 -> CurSkill (So I know which set of levels you're playing)
  327.     
  328. Start_New:
  329.     call _clrScrn                    ;clear the screen and the text shaddow
  330.     ld hl,0
  331.     ld (Score),hl                    ;0 -> Score
  332. LoadNewLevel:
  333.     call Load_New_Level
  334.     jr continue
  335.  
  336.                                         ;This is the first complicated part...
  337. Load_New_Level:
  338.                         ;a random routine by Jimmy Mardell
  339.      ld b,4                ;4 -> b (integer between 0 and 3)
  340.      ld a,r                ;r -> a - donno what r is ?? (some thing fairly random I guess
  341.      add a,a                ;doubles a
  342.      ld hl,0                ;0 -> h , 0 -> l
  343.      ld d,0                ;0 -> d
  344.      ld e,a                ;a -> e
  345. RMul:
  346.      add hl,de            ;adds de to hl and stores it in hl
  347.                                 ;e will be added to l until it's greater than 255, then a 1 is put in h and 0 into l
  348.      djnz RMul            ;decrement b and if it isn't 0 jump to RMul
  349.      ld a,h                ;h -> a
  350.                         ;end of the random routine
  351.  
  352.     inc a                        ;increment a so it's between 1 and 4
  353.     cp 1                        ;check if a = 1
  354.     jr nz,Two                ;if it isn't, goto Two and check if it's 2
  355.     ld hl,Block1        ;hl points to Block1
  356.     jr Load_Block        ;jump to Load_Block
  357.  
  358. Two:                            ;the same as above, but checks if a = 2
  359.     cp 2
  360.     jr nz,Three
  361.     ld hl,Block2
  362.     jr Load_Block
  363. Three:                        ;the same, but checks if a = 3
  364.     cp 3
  365.     jr nz,Four
  366.     ld hl,Block3
  367.     jr Load_Block
  368. Four;                            ;if a <> 1, 2, or 3, then it = 4...
  369.     ld hl,Block4        ;hl points to Block4
  370.  
  371. Load_Block:
  372.     ld de,Temp_Block_L        ;points de to Temp_Block_L
  373.     ld bc,24                            ;24 -> bc (24 bytes to copy)
  374.     ldir                                    ;copies 24 bytes of hl into de (temporary storage to be manipulated and not destroyed
  375.     ret
  376.  
  377. continue:
  378.     ld a,20                                ;20 -> a
  379.     ld (Time_Delay),a            ;a -> Time_Delay
  380.  
  381.     ld hl,(Level)                    ;\_ loads the level into l
  382.     ld b,l                                ;/
  383.     ld ix,Times-1                    ;points ix to 1 bytes before Times
  384. inc_ix:
  385.     inc ix                                ; points ix forward 1 bytes
  386.     djnz inc_ix                        ;loop b amount of times
  387.     ld h,0                                ;0 -> h
  388.     ld a,(ix)                            ;level time -> a
  389.     ld l,a                                ;a -> l
  390.     ld (Timer),hl                    ;level time -> Timer
  391.  
  392.     ld hl,(Level)                    ;level -> hl
  393.     ld b,l                                ;l -> b (the level number)
  394.     ld ix,Bonuses-1                ;ix points 1 byte behind of ix
  395. inc_ix2:
  396.     inc ix                                ;point ix 1 byte forward
  397.     djnz inc_ix2                    ;decrement b and if it isn't 0, jump to inc_ix2
  398.     ld h,0                                ;0 -> h
  399.     ld a,(ix)                            ;level bonus -> a
  400.     ld l,a                                ;a -> l
  401.     ld (Bonus),hl                    ;level bonus -> Bonus
  402.  
  403. ;**************************************************************************
  404. ;**If you're just learning the asm language, that's the end of the highly**
  405. ;**detailed, step-by-step instructions.  From here on out, I'm just going**
  406. ;**explain what I'm doing and why because it's a little more complicated.**
  407. ;**************************************************************************
  408.  
  409. Refresh_Old_Level:
  410.     call Level_To_Temp            ;loads the current level into a temporary variable
  411.     call Refresh_Background    ;puts the blocks, and the goal on the screen
  412.     ld hl,Temp_Level+16            ;this is where the Bob's coords are
  413.     ld a,(hl)
  414.     ld (BobX),a
  415.     ld d,a
  416.     inc hl
  417.     ld a,(hl)
  418.     ld (BobY),a
  419.     ld e,a
  420.     ld ix,Bob
  421.     call PutSprite                    ;puts Bob where he belongs
  422.  
  423. PutSideBar:                    ;this puts the stuff on the side; I'll explain one-
  424.     ld de,$0000                ;0 -> d, 0-> e
  425.     ld (_penCol),de        ;d -> (_penCol), e -> (_penRow)
  426.     ld hl,SideBar            ;SideBar text -> hl
  427.     call _vputs                ;put small font
  428.     ld de,$0D00
  429.     ld (_penCol),de
  430.     call _vputs
  431.     ld de,$1A00
  432.     ld (_penCol),de
  433.     call _vputs
  434.     ld de,$2700
  435.     ld (_penCol),de
  436.     call _vputs
  437.     ld de,$0600
  438.     ld (_penCol),de
  439.     ld hl,(Level)
  440.     call _vputHL            ;_vputHL is a routine (Later in the program) that turns
  441.                                         ;a number in hl (0-65535) into text and puts in the small font
  442.     ld de,$1300
  443.     ld (_penCol),de
  444.     ld hl,(Score)
  445.     call _vputHL
  446.     ld de,$2000
  447.     ld (_penCol),de
  448.     ld hl,(Bonus)
  449.     call _vputHL
  450.     ld de,$2D00
  451.     ld (_penCol),de
  452.     ld hl,(Timer)
  453.     call _vputHL
  454.  
  455.  
  456. Main_Loop:
  457.     call Refresh_Background    ;puts the blocks, and the goal on the screen
  458.  
  459.     ld a,(Time_Delay)        ;the time delay makes the time run slower
  460.     dec a
  461.     ld (Time_Delay),a
  462.     cp 0
  463.     jr nz, no_Time_Dec    ;if the time delay = 0, then it's reset and the timer is decremented
  464.     ld a,20
  465.     ld (Time_Delay),a
  466.     ld hl,(Timer)
  467.     dec hl
  468.     ld (Timer),hl
  469.     ld de,0
  470.     call _cphlde            ;compares hl and de
  471.     jp z,TimeUp
  472. no_Time_Dec:
  473.     ld de,$2D00
  474.     ld (_penCol),de
  475.     ld hl,(Timer)
  476.     call _vputHL            ;this puts the time left
  477.  
  478.     ld de,$2000
  479.     ld (_penCol),de
  480.     ld hl,(Bonus)
  481.     call _vputHL            ;this puts the bonus left
  482.  
  483.     call _getcode            ;works just like _getky or GET_KEY, but supposed to be faster
  484.     cp K_EXIT
  485.     jp z,CheckScore        ;check if you have a high score
  486.     cp K_LEFT
  487.     jr z,Left                    ;move left if Bob can
  488.     cp K_RIGHT
  489.     jp z,Right                ;move right if Bob can
  490.     cp K_UP
  491.     jp z,Up                        ;Move up if Bob can
  492.     cp K_DOWN
  493.     jp z,Down                    ;move down if Bob can
  494.     cp K_SECOND
  495.     jr z,Second                ;reset the level
  496.     cp K_MORE
  497.     jr z,Pause                ;pause
  498.     jp Main_Loop
  499.  
  500. ;***************************************************
  501. ;*----Stuff that happens after a key is pressed----*
  502. ;***************************************************
  503.  
  504.  
  505. Exit:
  506.     set plotloc,(iy+plotflags)                ;lets the graph write to the graph buffer
  507.     set appTextSave,(iy+appflags)            ;saves the text to the text shaddow
  508.     set appAutoScroll,(iy+appflags)        ;lets the screen scroll
  509.     set graphdraw,(IY+graphflags)            ;tells the calc that the graph is "dirty"
  510.                                                                         ;so it will redraw it
  511.     call _clrScrn    ;clear the screen and text shaddow
  512.     call _homeup    ;cur = 0,0
  513.     ld a,($C008)    ;load contrast value
  514.     dec a                    ;increase the contrast
  515.     ld ($C008),a    ;write it back to memory
  516.     out (2),a            ;and to the port
  517.     ret                        ;return to the OS
  518.  
  519. Pause:
  520.     call _clrScrn            ;clear the screen
  521.     call _homeup            ;cur to 0,0
  522.     ld hl,Paused
  523.     call _puts                ;display paused text
  524. Paused_Loop:
  525.     call _getcode
  526.     cp 0
  527.     jr z,Paused_Loop    ;loop until a key is pressed
  528.     call _clrScrn
  529.     ld a,(BobX)
  530.     ld d,a
  531.     ld a,(BobY)
  532.     ld e,a
  533.     ld ix,Bob
  534.     call PutSprite        ;put Bob where he belongs
  535.     jp PutSideBar            ;put the side bar and then continue on with the game
  536.  
  537. Second:
  538.     call _clrScrn
  539.     jp Refresh_Old_Level    ;this will reset the level
  540.  
  541.  
  542.  
  543. Left:                                        ;This is where it gets a little confusing!
  544.     ld a,(BobX)
  545.     ld d,a                                ;x-coord into d
  546.     dec d                                    ;to see where Bob is if he moves left
  547.     ld a,(BobY)
  548.     ld e,a                                ;y-coord into e
  549.     ld a,(Temp_Level+18)
  550.     ld h,a                                ;x-coord of goal into h
  551.     ld a,(Temp_Level+19)
  552.     ld l,a                                ;y-coord of goal into l
  553.     call _cphlde                    ;compare hl and de
  554.     jp z,Finish                        ;if they're equal, you passed the level
  555.  
  556.     ld a,(BobY)
  557.     ld b,a                                ;y-coord into b
  558.     inc b                                    ;increment b incase it's 0 (I know it can't bo 0, but
  559.                                                 ;in a later version it might be possible
  560.     ld hl,Temp_Level-2
  561. Inc_HL_L:
  562.     inc hl
  563.     inc hl
  564.     djnz Inc_HL_L        ;if the y-coord was 0, then hl points to the first byte
  565.                                     ;of the temp level.  It moves hl forward 2 bytes for each line
  566.     ld a,(BobX)
  567.     inc a                        ;To make x-coord between 1 & 16 rather than 0 & 15
  568.     cp 3
  569.     jp z,Main_Loop    ;If Bob is as far left as he can go, return to the main loop
  570.     cp 8                        ;if the x-coord is 8, then when 8 is subtracted, the answer is
  571.     jr z,sub8L            ;considered positive and the program thinks that it wants to
  572.                                     ;move to the next byte.  So, we have to skip the test.
  573.     cp 9                ;Same goes for 9 except the program's right to move ahead 1 byte.
  574.     jr z,sub8L    ;It's also wrong because it can't look ahead to see that it needs
  575.                             ;to check for a block or a space to the left (in the first byte).
  576.     inc hl            ;move ahead one byte so we don't have to do it later
  577.     ld b,a            ;a -> b incase a is smaller than 8
  578.     sub 8                ;a-8 -> a
  579.     jp p,sub8L    ;if it's positive, there's no need to restore a
  580.     ld a,b            ;if it's negative, you need to restore a
  581.     dec hl            ;and move hl back to where it was
  582. sub8L:
  583.     ld b,a            ;stores a in b for the loop
  584.     ld d,a            ;1 -> d for storage so we know how many times to rotate a back to normal
  585.     ld a,(hl)        ;the piece of the tmp level map is moved to a for easier access
  586.     rrca                ;rotate a one bit to the right so if a = 1, it will still be normal
  587.                             ;in case you don't know, rrca takes the binary equivalent    and rotates
  588.                             ;one bit to the right circular, meaning bit 0 (the begining) is moved
  589.                             ;to bit 7 (the end), and the carry flag is = to bit 7.
  590. Rotate_aL:    
  591.     rlca                ;does the same as rrca, but to the right and the carry flag = bit 0
  592.     djnz Rotate_aL
  593.     jr c,BlockL        ;if the carry flag was set, it means there is a block to the left
  594.     jr Move_Left    ;if there isn't a block on the left, just move Bob left
  595.  
  596. Nine_L:
  597.     dec hl                    ;move to the previous byte of the temp level map
  598.     bit 0,(hl)            ;check if there is a block on the right edge of the byte
  599.     jp nz,Main_Loop    ;if there is a block in the way, jump to the main loop
  600.     set 0,(hl)            ;since there isn't a block, we have to make a block here
  601.     inc hl                    ;move to the next block
  602.     res 7,(hl)            ;and remove the old block
  603.     jr Move_Left        ;then move Bob left
  604.  
  605. BlockL:
  606.     ld b,a                    ;save the rotated piece of the temp level map for later
  607.     ld a,(BobX)
  608.     cp 3                        ;if the x-coord is 3, then the block is against the edge
  609.     jp z,Main_Loop
  610.     cp 9                        ;if the x-coord is 9, we need to move to the previous byte
  611.     jr z,Nine_L
  612.     ld a,b                    ;a = the rotated piece of the templevel map again
  613.     rrca                        ;rotate right circular twice
  614.     rrca
  615.     jp c,Main_Loop    ;if there is a block to the left of the block that's on the
  616.                                     ;of Bob, he can't push it.  Go back to the main loop.
  617.     set 7,a                    ;if there isn't a block there, make one there
  618.     rlca
  619.     res 7,a                    ;and remove the block to the left of Bob
  620.     ld b,d                    ;b = the # of times to rotate a back to normal
  621.     rlca                        ;rotate left circular twice to make up for rotating it right twice
  622.     rlca
  623. Rotate_Back_L:
  624.     rrca
  625.     djnz Rotate_Back_L
  626.     ld (hl),a                                ;save a in the temporary level map
  627.  
  628. Move_Left:
  629.     ld hl,(Bonus)
  630.     ld a,l                    ;since the bonus is going to be less than $FF (255) h will be 0
  631.     cp 0
  632.     jr z,NOBonus_L
  633.     dec hl                    ;if there is some bounus left, decrement it
  634.     ld (Bonus),hl
  635. NOBonus_L:
  636.  
  637.     ld a,(BobX)
  638.     ld d,a
  639.     ld a,(BobY)
  640.     ld e,a
  641.     ld ix,Blank
  642.     call PutSprite    ;erase where Bob was,
  643.     ld a,(BobX)
  644.     dec a                        ;move him left
  645.     ld (BobX),a
  646.     ld d,a
  647.     ld ix,Bob
  648.     call PutSprite    ;and draw him
  649.     jp Main_Loop        ;jump to the main loop to continue
  650.  
  651.  
  652. Right:                        ;almost the same as going left, but diferent variables, and
  653.                                     ;oppisite directions.  So refer to the left routine for more details
  654.     ld a,(BobX)
  655.     ld d,a
  656.     inc d
  657.     ld a,(BobY)
  658.     ld e,a
  659.     ld a,(Temp_Level+18)
  660.     ld h,a
  661.     ld a,(Temp_Level+19)
  662.     ld l,a
  663.     call _cphlde        ;if Bob just moved into the goal, you passed the level
  664.     jp z,Finish
  665.  
  666.     ld a,(BobY)
  667.     ld b,a
  668.     inc b
  669.     ld hl,Temp_Level-1
  670. Inc_HL_R:
  671.     inc hl
  672.     inc hl
  673.     djnz Inc_HL_R
  674.     ld a,(BobX)
  675.     inc a                            ;To make x-coord between 1 & 16 rather than 0 & 15
  676.     cp 16
  677.     jp z,Main_Loop
  678.     cp 8
  679.     jr z,Eight_R
  680.     ld b,a
  681.     sub 8
  682.     jp p,Positive_R
  683.     ld a,b
  684.     dec hl
  685. Positive_R:
  686.     ld b,a
  687.     ld d,a
  688.     ld a,(hl)
  689. Rotate_aR:
  690.     rlca
  691.     djnz Rotate_aR
  692.     rlca
  693.     jr c,BlockR
  694.     jr Move_Right
  695.  
  696. Eight_R:
  697.     ld d,0
  698.     ld a,(hl)
  699.     rlca
  700.     jr c,BlockR
  701.     jr Move_Right
  702.     
  703. Six_R:
  704.     inc hl
  705.     bit 7,(hl)
  706.     jp nz,Main_Loop
  707.     set 7,(hl)
  708.     dec hl
  709.     res 0,(hl)
  710.     call Refresh_Background
  711.     jr Move_Right
  712.  
  713. BlockR:
  714.     ld b,a
  715.     ld a,(BobX)
  716.     cp 14
  717.     jp z,Main_Loop
  718.     cp 6
  719.     jr z,Six_R
  720.     ld a,b
  721.     rlca
  722.     jp c,Main_Loop
  723.     set 0,a
  724.     res 1,a
  725.     rrca
  726.     ld b,a
  727.     ld a,d
  728.     cp 0
  729.     jr z,No_Rotate_Back_R
  730.     ld a,b
  731.     ld b,d
  732. Rotate_Back_R:
  733.     rrca
  734.     djnz Rotate_Back_R
  735.     ld b,a
  736. No_Rotate_Back_R:
  737.     ld a,b
  738.     rrca
  739.     ld (hl),a
  740.     call Refresh_Background
  741.  
  742. Move_Right
  743.     ld hl,(Bonus)
  744.     ld a,l
  745.     cp 0
  746.     jr z,NOBonus_R
  747.     dec hl
  748.     ld (Bonus),hl
  749. NOBonus_R:
  750.  
  751.     ld a,(BobX)
  752.     ld d,a
  753.     ld a,(BobY)
  754.     ld e,a
  755.     ld ix,Blank
  756.     call PutSprite
  757.     ld a,(BobX)
  758.     inc a
  759.     ld (BobX),a
  760.     ld d,a
  761.     ld ix,Bob
  762.     call PutSprite
  763.     jp Main_Loop
  764.  
  765.  
  766. Up:
  767.     ld a,(BobX)
  768.     ld d,a
  769.     ld a,(BobY)
  770.     ld e,a
  771.     dec e
  772.     ld a,(Temp_Level+18)
  773.     ld h,a
  774.     ld a,(Temp_Level+19)
  775.     ld l,a
  776.     call _cphlde
  777.     jp z,Finish
  778.  
  779.     ld a,(BobY)
  780.     cp 0
  781.     jp z,Main_Loop
  782.     ld b,a
  783.     inc b
  784.     ld hl,Temp_Level-3
  785. INC_Y_U:
  786.     inc hl
  787.     inc hl
  788.     djnz INC_Y_U
  789.     ld a,(BobX)
  790.     inc a                                    ;make x-coord between 1 and 16
  791.     ld b,a
  792.     cp 8
  793.     jr z,No_Sub_U
  794.     sub 8
  795.     jp p,Positive_U
  796. No_Sub_U:
  797.     ld a,b
  798.     dec hl
  799. Positive_U:
  800.     dec hl
  801.     dec hl
  802.     ld c,(hl)
  803.     inc hl
  804.     inc hl
  805.     ld b,a
  806.     ld d,a
  807.     ld a,(hl)
  808. Rotate_U:
  809.     rlc c
  810.     rlca
  811.     djnz Rotate_U
  812.     jr c,Block_U
  813.     jr Move_Up    
  814.  
  815. Block_U:
  816.     ld b,a
  817.     ld a,(BobY)
  818.     cp 1
  819.     jp z,Main_Loop
  820.     bit 0,c
  821.     jp nz,Main_Loop
  822.     set 0,c
  823.     ld a,b
  824.     res 0,a
  825.     ld b,d
  826. Rotate_Back_U:
  827.     rrc c
  828.     rrca
  829.     djnz Rotate_Back_U
  830.     ld (hl),a
  831.     dec hl
  832.     dec hl
  833.     ld (hl),c    
  834.     call Refresh_Background
  835.  
  836. Move_Up:
  837.     ld hl,(Bonus)
  838.     ld a,l
  839.     cp 0
  840.     jr z,NOBonus_U
  841.     dec hl
  842.     ld (Bonus),hl
  843. NOBonus_U:
  844.  
  845.     ld a,(BobY)
  846.     ld e,a
  847.     dec a
  848.     ld (BobY),a
  849.     ld a,(BobX)
  850.     ld d,a
  851.     ld ix,Blank
  852.     call PutSprite
  853.     dec e
  854.     ld ix,Bob
  855.     call PutSprite
  856.     jp Main_Loop
  857.  
  858.  
  859.  
  860.  
  861. Down:
  862.     ld a,(BobX)
  863.     ld d,a
  864.     ld a,(BobY)
  865.     ld e,a
  866.     inc e
  867.     ld a,(Temp_Level+18)
  868.     ld h,a
  869.     ld a,(Temp_Level+19)
  870.     ld l,a
  871.     call _cphlde
  872.     jp z,Finish
  873.  
  874.     ld a,(BobY)
  875.     cp 7
  876.     jp z,Main_Loop
  877.     ld b,a
  878.     inc b
  879.     ld hl,Temp_Level+1
  880. INC_Y_D:
  881.     inc hl
  882.     inc hl
  883.     djnz INC_Y_D
  884.     ld a,(BobX)
  885.     inc a                                    ;make x-coord between 1 and 16
  886.     ld b,a
  887.     cp 8
  888.     jr z,No_Sub_D
  889.     sub 8
  890.     jp p,Positive_D
  891. No_Sub_D:
  892.     ld a,b
  893.     dec hl
  894. Positive_D:
  895.     inc hl
  896.     inc hl
  897.     ld c,(hl)
  898.     dec hl
  899.     dec hl
  900.     ld b,a
  901.     ld d,a
  902.     ld a,(hl)
  903. Rotate_D:
  904.     rlc c
  905.     rlca
  906.     djnz Rotate_D
  907.     jr c,Block_D
  908.     jr Move_Down    
  909.  
  910. Block_D:
  911.     ld b,a
  912.     ld a,(BobY)
  913.     cp 6
  914.     jp z,Main_Loop
  915.     bit 0,c
  916.     jp nz,Main_Loop
  917.     set 0,c
  918.     ld a,b
  919.     res 0,a
  920.     ld b,d
  921. Rotate_Back_D:
  922.     rrc c
  923.     rrca
  924.     djnz Rotate_Back_D
  925.     ld (hl),a
  926.     inc hl
  927.     inc hl
  928.     ld (hl),c    
  929.     call Refresh_Background
  930.  
  931. Move_Down:
  932.     ld hl,(Bonus)
  933.     ld a,l
  934.     cp 0
  935.     jr z,NOBonus_D
  936.     dec hl
  937.     ld (Bonus),hl
  938. NOBonus_D:
  939.  
  940.     ld a,(BobY)
  941.     ld e,a
  942.     inc a
  943.     ld (BobY),a
  944.     ld a,(BobX)
  945.     ld d,a
  946.     ld ix,Blank
  947.     call PutSprite
  948.     inc e
  949.     ld ix,Bob
  950.     call PutSprite
  951.     jp Main_Loop
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958. ;*****************************
  959. ;*-------Some Routines-------*
  960. ;*****************************
  961.  
  962. Level_To_Temp:
  963.     ld de,(Level)
  964.     ld b,e
  965.     ld de,20
  966.     ld hl,Level_Data-20
  967. Level_Loop:
  968.     add hl,de
  969.     djnz Level_Loop
  970.     ld de,Temp_Level
  971.     ld bc,20
  972.     ldir
  973.     ret
  974.  
  975. Refresh_Background:
  976.     ld hl,Temp_Block_L
  977.     ld de,Temp_Block
  978.     ld bc,8
  979.     ldir
  980.     ld hl,Temp_Block_L+8
  981.     ld de,Temp_Block_L
  982.     ld bc,8
  983.     ldir
  984.     ld hl,Temp_Block_L+16
  985.     ld de,Temp_Block_L+8
  986.     ld bc,8
  987.     ldir
  988.     ld hl,Temp_Block
  989.     ld de,Temp_Block_L+16
  990.     ld bc,8
  991.     ldir
  992.  
  993.     ld hl,Temp_Level-1
  994.     ld c,0
  995.     ld b,8
  996.     ld de,0
  997. Next_Loop:
  998.     push bc
  999. Next_Loop2:
  1000.     ld b,8
  1001.     inc hl
  1002.     ld a,(hl)    
  1003. Again_B:
  1004.     rla
  1005.     jr nc,Next_B
  1006.     ld ix,Temp_Block
  1007.     call PutSprite
  1008. Next_B:
  1009.     inc d
  1010.     djnz Again_B
  1011.     ld a,d
  1012.     cp 8
  1013.     jr z,Next_Loop2
  1014.     ld d,0
  1015.     inc e
  1016.     push de
  1017.     ld ix,Temp_Level+18
  1018.     ld a,(ix)
  1019.     ld d,a
  1020.     inc ix
  1021.     ld a,(ix)
  1022.     ld e,a
  1023.     ld ix,Goal
  1024.     call PutSprite
  1025.     pop de
  1026.     pop bc
  1027.     djnz Next_Loop
  1028.     ret
  1029.  
  1030. TimeUp:
  1031.     ld de,$0703
  1032.     ld (_curRow),de
  1033.     ld hl,TimeUP
  1034.     set textInverse,(iy+textflags)
  1035.     call _puts
  1036.     res textInverse,(iy+textflags)
  1037.     ld b,30
  1038. T_Loop:
  1039.     push bc
  1040.     call Refresh_Background
  1041.     ld de,$0703
  1042.     ld (_curRow),de
  1043.     ld hl,TimeUP
  1044.     set textInverse,(iy+textflags)
  1045.     call _puts
  1046.     res textInverse,(iy+textflags)
  1047.     halt
  1048.     halt
  1049.     halt
  1050.     halt
  1051.     halt
  1052.     halt
  1053.     halt
  1054.     pop bc
  1055.     djnz T_Loop
  1056.     jp CheckScore
  1057.  
  1058. Finish:
  1059.     ld de,(Timer)
  1060.     ld hl,(Score)
  1061.     add hl,de
  1062.     add hl,de
  1063.     ld de,(Bonus)
  1064.     add hl,de
  1065.     add hl,de
  1066.     ld (Score),hl
  1067.     ld hl,(Level)
  1068.     inc hl
  1069.     ld (Level),hl
  1070.     ld a,l
  1071.     cp 11
  1072.     jr nz,SKILL1
  1073.     ld a,(Skill)
  1074.     cp 0
  1075.     jr nz,Passed
  1076.     inc a
  1077.     ld (Skill),a
  1078.     call SaveScore
  1079.     jr Passed
  1080. SKILL1:
  1081.     cp 21
  1082.     jr nz,SKILL2
  1083.     ld a,(Skill)
  1084.     cp 1
  1085.     jr nz,Passed
  1086.     inc a
  1087.     ld (Skill),a
  1088.     call SaveScore
  1089.     jr Passed
  1090. SKILL2:
  1091.     cp 31
  1092.     jr z,Passed
  1093.     call _clrScrn
  1094.     jp LoadNewLevel
  1095.  
  1096. Passed:
  1097.     call _clrScrn
  1098.     call _homeup
  1099.     ld hl,Congrats
  1100.     call _puts
  1101.     ld de,(Level)
  1102.     ld a,e
  1103.     cp 11
  1104.     jr z,PutLevel
  1105.     cp 21
  1106.     jr nz,HardL
  1107.     ld de,22
  1108.     add hl,de
  1109.     jr PutLevel
  1110. HardL:
  1111.     ld de,44
  1112.     add hl,de
  1113. PutLevel:
  1114.     call _puts
  1115.     ld de,$2E10
  1116.     ld (_penCol),de
  1117.     ld hl,C_Score
  1118.     call _vputs
  1119.     set textEraseBelow,(iy+textflags)
  1120.     set textInverse,(iy+textflags)
  1121.     ld a,$56
  1122.     ld (_penCol),a
  1123.     ld a,' '
  1124.     call _vputmap
  1125.     ld hl,(Score)
  1126.     call _vputHL
  1127.     res textEraseBelow,(iy+textflags)
  1128.     res textInverse,(iy+textflags)
  1129. Pass_Loop:
  1130.     call _getcode
  1131.     cp 0
  1132.     jr z,Pass_Loop
  1133.  
  1134.  
  1135. CheckScore:
  1136.     ld de,(Score)
  1137.     ld a,(CurSkill)
  1138.     cp 1
  1139.     jr nz,MediumScore
  1140.     ld hl,(HighScoreE)
  1141.     call _cphlde
  1142.     jp nc,ViewScores
  1143.     ld (HighScoreE),de
  1144.     jr New_HighScore
  1145. MediumScore:
  1146.     cp 2
  1147.     jr nz,HardScore
  1148.     ld hl,(HighScoreM)
  1149.     call _cphlde
  1150.     jp nc,ViewScores
  1151.     ld (HighScoreM),de
  1152.     jr New_HighScore
  1153. HardScore:
  1154.     cp 3
  1155.     jr nz,HardScore
  1156.     ld hl,(HighScoreH)
  1157.     call _cphlde
  1158.     jp nc,ViewScores
  1159.     ld (HighScoreH),de
  1160.     jr New_HighScore
  1161.  
  1162.  
  1163. New_HighScore:
  1164.     call _clrScrn
  1165.     call _homeup
  1166.     ld hl,NewHS
  1167.     call _puts
  1168.     ld de,$0003
  1169.     ld (_curRow),de
  1170.     ld ix,HighScore
  1171.     ld a,(CurSkill)
  1172.     cp 1
  1173.     jr z,EnterName
  1174.     cp 2
  1175.     jr nz,HardHS
  1176.     ld de,20
  1177.     add ix,de
  1178.     jr EnterName
  1179. HardHS:
  1180.     ld de,40
  1181.     add ix,de
  1182. EnterName
  1183.     set curAble,(iy+curflags)
  1184.     ld b,14
  1185.     res 5,(iy+shiftflags)
  1186. ALPHA:
  1187.     bit 5,(iy+shiftflags)
  1188.     jr z,lower
  1189.     res 5,(iy+shiftflags)
  1190.     jr EnterName_Loop
  1191. lower:
  1192.     set 5,(iy+shiftflags)
  1193. EnterName_Loop:
  1194.     push bc
  1195.     call _getky
  1196.     pop bc
  1197.     cp K_ENTER
  1198.     jr z,Saveit
  1199.     cp K_LEFT
  1200.     jr z,Delete
  1201.     cp K_DEL
  1202.     jr z,Delete
  1203.     cp K_ALPHA
  1204.     jr z,ALPHA
  1205.     ld c,a
  1206.     ld a,b
  1207.     cp 0
  1208.     jr z,EnterName_Loop
  1209.     ld a,c
  1210.     cp $09
  1211.     jr c,EnterName_Loop
  1212.     cp $2F
  1213.     jr nc,EnterName_Loop
  1214.  
  1215.     push bc
  1216.     sub 9
  1217.     ld b,a
  1218.     ld hl,CharTable-1
  1219. CharLoop:
  1220.     inc hl
  1221.     djnz CharLoop
  1222.     pop bc
  1223.     ld a,(hl)
  1224.     cp 0
  1225.     jr z,EnterName_Loop
  1226.     cp ' '
  1227.     jr z,CAPS
  1228.     bit 5,(iy+shiftflags)
  1229.     jr nz,CAPS
  1230.     add a,32
  1231. CAPS: 
  1232.     ld (ix),a
  1233.     inc ix
  1234.     call _putc
  1235.     dec b
  1236.     jr EnterName_Loop
  1237.  
  1238. Delete:
  1239.     ld a,b
  1240.     cp 14
  1241.     jr z,EnterName_Loop
  1242.     res curAble,(iy+curflags)
  1243.     ld a,' '
  1244.     call _putc
  1245.     ld hl,_curCol
  1246.     dec (hl)
  1247.     dec (hl)
  1248.     call _putc
  1249.     dec (hl)
  1250.     inc b
  1251.     dec ix
  1252.     ld (ix),'.'
  1253.     set curAble,(iy+curflags)
  1254.     jr EnterName_Loop
  1255.  
  1256. Saveit:
  1257.     res curAble,(iy+curflags)
  1258.     ld a,b
  1259.     add a,3
  1260.     ld b,a
  1261. Dots:
  1262.     ld (ix),'.'
  1263.     inc ix
  1264.     djnz Dots
  1265.     res shiftALock,(iy+shiftflags)
  1266.     res shiftAlpha,(iy+shiftflags)
  1267.     call SaveScore
  1268.     jp ViewScores
  1269.  
  1270. _vputHL:              ;Writes hl on screen (Small font)
  1271.  ld de,VPTEMP+3       ;location to start unpacking
  1272.  ld b,4               ;4 digits
  1273. _vputHL_2:            ;Begin loop
  1274.  call UNPACK_HL       ;divide hl by 10 - a contains remainder
  1275.  add a,'0'            ;asciiize it
  1276.  ld (de),a            ;store digit
  1277.  dec de               ;de points to next digit place
  1278.  djnz _vputHL_2       ;decrease b - repeat if not zero
  1279.  ld hl,VPTEMP         ;hl points to number
  1280.  call _vputs          ;write number on screen
  1281.  ret                  ;return
  1282.  
  1283. _putHL:               ;Writes hl on screen (Large Font)
  1284.  ld de,VPTEMP+3       ;location to start unpacking
  1285.  ld b,4               ;4 digits
  1286. _putHL_2:            ;Begin loop
  1287.  call UNPACK_HL       ;divide hl by 10 - a contains remainder
  1288.  add a,'0'            ;asciiize it
  1289.  ld (de),a            ;store digit
  1290.  dec de               ;de points to next digit place
  1291.  djnz _putHL_2       ;decrease b - repeat if not zero
  1292.  ld hl,VPTEMP         ;hl points to number
  1293.  call _puts          ;write number on screen
  1294.  ret                  ;return
  1295.  
  1296. delay:
  1297.     push bc
  1298.     ld b,100
  1299. D_Loop:
  1300.     halt
  1301.     halt
  1302.     djnz D_Loop
  1303.     pop bc
  1304.     ret
  1305.  
  1306. ;****Taken From ZTetris, But the bytes to copy and some labels were modified
  1307.  
  1308. SaveScore:                                 ;Saves The New High Score
  1309.     ld hl,ProgName        ; All this stuff is to make sure the hiscore table
  1310.     rst 20h           ; and resume stuff are stored in the variable
  1311.     rst 10h
  1312.     ex de,hl           ; HL -> start of variable
  1313.     ld a,b
  1314.     ld de,HighScore-$D748+4  ; DE = relative offset to stuff to store (-4)
  1315.     add hl,de
  1316.     adc a,0           ; Next block if necessary
  1317.     ld de,HighScore           ; DE = start of bytes to copy
  1318.     ld b,61           ; 61 bytes to copy
  1319. RepCopy:
  1320.     push af
  1321.     push hl
  1322.     call $46C3
  1323.     ld a,(de)           ; Read
  1324.     ld (hl),a           ; And save it in the real variable
  1325.     pop hl
  1326.     pop af
  1327.     call $4637
  1328.     inc de
  1329.     djnz RepCopy
  1330.     ret
  1331.  
  1332. ;************************************************
  1333. ;* PutSprite -- By Levi Lansing                 *
  1334. ;*  Input:                                      *
  1335. ;*      (d,e) = pos -- (0,0) to (16,8)          *
  1336. ;*      ix = Sprite (8 by 8)                    *
  1337. ;*  Output:                                     *
  1338. ;*      Your sprite right over the top of       *
  1339. ;*      everything!    (0 clears the pixel and     *
  1340. ;*      1 turns on the pixel)                   *
  1341. ;*  Changed:                                    *
  1342. ;*      ix (points to the next Sprite or Data)  *
  1343. ;************************************************
  1344.  
  1345. PutSprite:
  1346.     push hl                ;hide these so they don't get changed
  1347.     push af                ;"
  1348.     push bc                ;"
  1349.     ld c,d                
  1350.     ld b,e                ;bc now = the coords of the image
  1351.     push de                ;hide de so it won't get changed
  1352.     ld hl,$FB80        ;Point 8 lines infront of the video memory (128 bytes)
  1353.                                 ;(the video mem starts at FC00)
  1354.     inc b                    ;add 1 to b incase it's 0
  1355.     ld de,128            ;# Of Bytes Per 8 Lines
  1356. YCoord:
  1357.     add hl,de            ;point hl forward 8 lines
  1358.     djnz YCoord
  1359.     add hl,bc            ;Now HL Points To the video memory + the offset
  1360.     ld de,16            ;# of bytes per 1 line
  1361.     ld b,8                ;# of lines in the sprite
  1362. Putit:
  1363.     ld a,(ix)            ;data of the first line of the sprite into a
  1364.     ld (hl),a            ;then onto the screen
  1365.     add hl,de            ;increase hl to point to the next line
  1366.     inc ix                ;increase ix to point to the next line of the sprite
  1367.     djnz Putit        ;loop 8 times
  1368.     pop de                ;then restore the variables that were hidden
  1369.     pop bc                ;in the oppisite order they were pushed
  1370.     pop af                ;to make sure they get the right values
  1371.     pop hl
  1372.     ret                        ;End Of The Routine
  1373.  
  1374.  
  1375. ;******************************
  1376. ;*-----Graphics / Sprites-----*
  1377. ;******************************
  1378.  
  1379. Written:
  1380.  
  1381.     .db %11111111
  1382.     .db %11011101
  1383.     .db %11011101
  1384.     .db %11010101
  1385.     .db %11101011
  1386.     .db %11111111
  1387.     .db %11111111
  1388.     .db %11111111
  1389.  
  1390.     .db %11111111
  1391.     .db %11101101
  1392.     .db %00111000
  1393.     .db %01101101
  1394.     .db %01101101
  1395.     .db %11111111
  1396.     .db %11111111
  1397.     .db %11111111
  1398.  
  1399.     .db %11111111
  1400.     .db %11011111
  1401.     .db %10001001
  1402.     .db %11011011
  1403.     .db %11011101
  1404.     .db %11111111
  1405.     .db %11111111
  1406.     .db %11111111
  1407.  
  1408.  
  1409.     .db %11111111
  1410.     .db %11111101
  1411.     .db %00111101
  1412.     .db %01011100
  1413.     .db %01011100
  1414.     .db %11111111
  1415.     .db %11111111
  1416.     .db %11111111
  1417.  
  1418.     .db %11111111
  1419.     .db %11111110
  1420.     .db %11111110
  1421.     .db %10101110
  1422.     .db %11011110
  1423.     .db %10111111
  1424.     .db %11111111
  1425.     .db %11111111
  1426.  
  1427.     .db %11111111
  1428.     .db %11111111
  1429.     .db %11100101
  1430.     .db %11101101
  1431.     .db %00110110
  1432.     .db %11111111
  1433.     .db %11111111
  1434.     .db %11111111
  1435.  
  1436.     .db %11111111
  1437.     .db %11011101
  1438.     .db %01111101
  1439.     .db %01011101
  1440.     .db %11011100
  1441.     .db %11111111
  1442.     .db %11111111
  1443.     .db %11111111
  1444.  
  1445.     .db %11111111
  1446.     .db %11111111
  1447.     .db %11000100
  1448.     .db %11010101
  1449.     .db %01100101
  1450.     .db %11111111
  1451.     .db %11111111
  1452.     .db %11111111
  1453.  
  1454.     .db %11111111
  1455.     .db %11111101
  1456.     .db %11100111
  1457.     .db %01101101
  1458.     .db %01001101
  1459.     .db %11111111
  1460.     .db %11111111
  1461.     .db %11111111
  1462.  
  1463.     .db %11111111
  1464.     .db %11111111
  1465.     .db %00110011
  1466.     .db %01010011
  1467.     .db %01011011
  1468.     .db %11100111
  1469.     .db %11111111
  1470.     .db %11111111
  1471.  
  1472.  
  1473. Bob:
  1474.     .db %00011000
  1475.     .db %00100100
  1476.     .db %00011000
  1477.     .db %01111110
  1478.     .db %00011000
  1479.     .db %00111100
  1480.     .db %00100100
  1481.     .db %00100100
  1482.  
  1483.  
  1484. Block1:                            ;The following are the blocks which have 4 shades to them
  1485.     .db %00000000            ;
  1486.     .db %01111110            ;pixels that show up once in the
  1487.     .db %01000010            ;three different sprites are light gray
  1488.     .db %01011010            ;
  1489.     .db %01011010            ;pixels that show up twice in the
  1490.     .db %01000010            ;three different sprites are dark gray
  1491.     .db %01111110            ;
  1492.     .db %00000000            ;pixels that show up thrice in the
  1493.                                         ;three sprites are black
  1494.     .db %11111111            ;
  1495.     .db %10111101            ;and of course, pixels  that arn't used in the
  1496.     .db %11111111            ;three sprites are white (if the contrast is low enough)
  1497.     .db %11100111            ;
  1498.     .db %11100111            ;
  1499.     .db %11111111            ;
  1500.     .db %10111101            ;
  1501.     .db %11111111            ;
  1502.                                         ;
  1503.     .db %00011000            ;
  1504.     .db %01111110            ;
  1505.     .db %01000010            ;
  1506.     .db %11011011            ;
  1507.     .db %11011011            ;
  1508.     .db %01000010            ;
  1509.     .db %01111110            ;
  1510.     .db %00011000            ;the first block ends here
  1511.  
  1512. Block2:                            ;I like this one the best because it really
  1513.     .db %00010001            ;makes all four shades stand out
  1514.     .db %00010010
  1515.     .db %00010000
  1516.     .db %11110000
  1517.     .db %00001111
  1518.     .db %00001000
  1519.     .db %01001000
  1520.     .db %10001000
  1521.  
  1522.     .db %01010101
  1523.     .db %11010110
  1524.     .db %00010111
  1525.     .db %11110000
  1526.     .db %00001111
  1527.     .db %11101000
  1528.     .db %01101011
  1529.     .db %10101010
  1530.  
  1531.     .db %11011111
  1532.     .db %11011111
  1533.     .db %00011111
  1534.     .db %11111111
  1535.     .db %11111111
  1536.     .db %11111000
  1537.     .db %11111011
  1538.     .db %11111011
  1539.  
  1540.  
  1541. Block3:
  1542.     .db %10000000
  1543.     .db %11000000
  1544.     .db %10000000
  1545.     .db %11000000
  1546.     .db %10000000
  1547.     .db %11000000
  1548.     .db %10101010
  1549.     .db %11111111
  1550.  
  1551.     .db %11110000
  1552.     .db %11100000
  1553.     .db %11110000
  1554.     .db %11100000
  1555.     .db %11110101
  1556.     .db %11111111
  1557.     .db %11111111
  1558.     .db %11111111
  1559.  
  1560.     .db %11111100
  1561.     .db %11111000
  1562.     .db %11111101
  1563.     .db %11111111
  1564.     .db %11111111
  1565.     .db %11111111
  1566.     .db %11111111
  1567.     .db %11111111
  1568.  
  1569. Block4:
  1570.     .db %00000000
  1571.     .db %01100110
  1572.     .db %01100110
  1573.     .db %00000000
  1574.     .db %00000000
  1575.     .db %01000010
  1576.     .db %00100100
  1577.     .db %00000000
  1578.  
  1579.     .db %00000000
  1580.     .db %01100110
  1581.     .db %01100110
  1582.     .db %00000000
  1583.     .db %00011000
  1584.     .db %01000010
  1585.     .db %00111100
  1586.     .db %00011000
  1587.  
  1588. Goal:                            ;this is the third sprite of the smile block
  1589.     .db %00111100        ;and the sprite for the goal because they are
  1590.     .db %01111110        ;same (Saves 8 whole bytes!).  (The label won't
  1591.     .db %11111111        ;get in the way)
  1592.     .db %11111111
  1593.     .db %11111111
  1594.     .db %11111111
  1595.     .db %01111110
  1596.     .db %00111100
  1597.  
  1598. Intro_Data:
  1599.     ;.db 16, 8
  1600.     .db %00011111, %11111000
  1601.     .db %00100000, %00000100
  1602.     .db %00100000, %00000100
  1603.     .db %00100000, %00000100
  1604.     .db %00011111, %11111000
  1605.     .db %00000000, %00000000
  1606.     .db %00000000, %00000000
  1607.     .db %00000000, %00000000
  1608.  
  1609.     .db 0,0
  1610.     .db 0,8
  1611.  
  1612.  
  1613. Level_Data:                                    ;   /This allows the sprite editor in Assembly
  1614.     ;.db 16, 8                                ;<-/Studio 86 ti read each level individually
  1615.     .db %00001101, %10011000    ;\
  1616.     .db %00001110, %11011000    ;|
  1617.     .db %00001111, %00111000    ;\
  1618.     .db %00001101, %01011000    ; \The 1's represent a block and the 0's
  1619.     .db %00001110, %11011000    ; / represent a space
  1620.     .db %00001111, %00111000    ;/
  1621.     .db %00001101, %11011000    ;|
  1622.     .db %00001110, %00111000    ;/
  1623.     .db 8,7                                        ;Bob's coords
  1624.     .db 8,0                                        ;Goal's coords
  1625.  
  1626.     ;.db 16, 8                                ;same for the rest of the thirty levels
  1627.     .db %00011110, %10111100
  1628.     .db %00011010, %00101100
  1629.     .db %00011011, %11011100
  1630.     .db %00011101, %01101100
  1631.     .db %00011010, %10011100
  1632.     .db %00011011, %01101100
  1633.     .db %00011100, %11011100
  1634.     .db %00011011, %01011100
  1635.     .db 8,7
  1636.     .db 8,0
  1637.  
  1638.     ;.db 16, 8
  1639.     .db %00011001, %10010110
  1640.     .db %00011010, %11001110
  1641.     .db %00011011, %10110110
  1642.     .db %00011000, %10100110
  1643.     .db %00011011, %11110110
  1644.     .db %00011011, %00110110
  1645.     .db %00011100, %11000110
  1646.     .db %00011010, %10111110
  1647.     .db 5,7
  1648.     .db 11,4
  1649.  
  1650.     ;.db 16, 8
  1651.     .db %00110100, %00011110
  1652.     .db %00111101, %11001110
  1653.     .db %00110000, %11111110
  1654.     .db %00111011, %01111110
  1655.     .db %00110110, %10000110
  1656.     .db %00110101, %01101110
  1657.     .db %00111111, %11010110
  1658.     .db %00110000, %00001110
  1659.     .db 12,4
  1660.     .db 11,2
  1661.  
  1662.     ;.db 16, 8
  1663.     .db %00111000, %00000111
  1664.     .db %00111001, %11111111
  1665.     .db %00110101, %01010011
  1666.     .db %00111011, %01011111
  1667.     .db %00110101, %01000011
  1668.     .db %00111011, %01111111
  1669.     .db %00110100, %00000011
  1670.     .db %00111001, %11111111
  1671.     .db 12,2
  1672.     .db 13,0
  1673.  
  1674.     ;.db 16, 8
  1675.     .db %00111001, %00101011
  1676.     .db %00111110, %10111111
  1677.     .db %00111011, %01000011
  1678.     .db %00100101, %00101011
  1679.     .db %00101001, %11011011
  1680.     .db %00101110, %01101111
  1681.     .db %00101001, %01001011
  1682.     .db %00111110, %10110111
  1683.     .db 13,0
  1684.     .db 3,7
  1685.  
  1686.     ;.db 16, 8
  1687.     .db %00110010, %00010011
  1688.     .db %00101010, %10010011
  1689.     .db %00110111, %11101011
  1690.     .db %00101001, %10010101
  1691.     .db %00100111, %01101101
  1692.     .db %00100110, %10101011
  1693.     .db %00101110, %01110101
  1694.     .db %00101011, %01011011
  1695.     .db 5,7
  1696.     .db 7,7
  1697.  
  1698.     ;.db 16, 8
  1699.     .db %00110001, %00101101
  1700.     .db %00010010, %01010001
  1701.     .db %00010101, %01001111
  1702.     .db %00010101, %11111001
  1703.     .db %00010111, %10110001
  1704.     .db %00011111, %00101011
  1705.     .db %00000100, %10100101
  1706.     .db %00001000, %11110101
  1707.     .db 14,0
  1708.     .db 2,0
  1709.  
  1710.     ;.db 16, 8
  1711.     .db %00000000, %00000000
  1712.     .db %00111111, %11111111
  1713.     .db %00000011, %00000010
  1714.     .db %00111100, %11110101
  1715.     .db %00000011, %00001010
  1716.     .db %00011111, %11111110
  1717.     .db %00100000, %10010000
  1718.     .db %00100110, %00100100
  1719.     .db 2,0
  1720.     .db 2,7
  1721.  
  1722.     ;.db 16, 8
  1723.     .db %00010011, %11000000
  1724.     .db %00011100, %11011010
  1725.     .db %00010100, %11011101
  1726.     .db %00011110, %10001010
  1727.     .db %00010101, %01110101
  1728.     .db %00011110, %10110011
  1729.     .db %00010101, %01100101
  1730.     .db %00000110, %01011000
  1731.     .db 2,7
  1732.     .db 15,6
  1733.  
  1734. :-----------Medium Levels-------
  1735.  
  1736.     ;.db 16, 8
  1737.     .db %00101010, %10100100
  1738.     .db %00101110, %01000100
  1739.     .db %00101011, %10111110
  1740.     .db %00111010, %01000010
  1741.     .db %00100100, %01111010
  1742.     .db %00011011, %10100111
  1743.     .db %00010100, %10001110
  1744.     .db %00101010, %10111010
  1745.     .db 15,7
  1746.     .db 2,1
  1747.  
  1748.     ;.db 16, 8
  1749.     .db %00010100, %01000000
  1750.     .db %00101011, %10011011
  1751.     .db %00001010, %00100111
  1752.     .db %00110001, %11011010
  1753.     .db %00001101, %01001010
  1754.     .db %00011111, %11010110
  1755.     .db %00010011, %01111100
  1756.     .db %00010000, %00001000
  1757.     .db 8,4
  1758.     .db 15,2
  1759.  
  1760.     ;.db 16, 8
  1761.     .db %00101000, %10001000
  1762.     .db %00001110, %00111011
  1763.     .db %00010010, %10110100
  1764.     .db %00010100, %01101000
  1765.     .db %00011011, %11110110
  1766.     .db %00010101, %10001001
  1767.     .db %00011100, %01110100
  1768.     .db %00001011, %00001010
  1769.     .db 15,2
  1770.     .db 4,7
  1771.  
  1772.     ;.db 16, 8
  1773.     .db %00010011, %11001001
  1774.     .db %00010101, %00101100
  1775.     .db %00010101, %01001010
  1776.     .db %00010101, %01011001
  1777.     .db %00010101, %01001011
  1778.     .db %00010101, %01101010
  1779.     .db %00010101, %01001110
  1780.     .db %00010100, %11010000
  1781.     .db 2,7
  1782.     .db 15,0
  1783.  
  1784.     ;.db 16, 8
  1785.     .db %00010101, %00010000
  1786.     .db %00101111, %10110111
  1787.     .db %00010001, %11010000
  1788.     .db %00001110, %10111111
  1789.     .db %00011010, %11001110
  1790.     .db %00010010, %10110100
  1791.     .db %00010011, %10011010
  1792.     .db %00100100, %10000101
  1793.     .db 15,0
  1794.     .db 2,7
  1795.  
  1796.     ;.db 16, 8
  1797.     .db %00001000, %00000100
  1798.     .db %00001111, %11100010
  1799.     .db %00110110, %00011101
  1800.     .db %00001101, %11011010
  1801.     .db %00010101, %10010101
  1802.     .db %00001111, %11110011
  1803.     .db %00110101, %00001100
  1804.     .db %00000100, %10011110
  1805.     .db 2,0
  1806.     .db 8,4
  1807.  
  1808.     ;.db 16, 8
  1809.     .db %00001100, %00001001
  1810.     .db %00010110, %11110101
  1811.     .db %00010011, %10011010
  1812.     .db %00001010, %10100111
  1813.     .db %00010111, %01101000
  1814.     .db %00101101, %01110111
  1815.     .db %00010010, %00100101
  1816.     .db %00111010, %11111111
  1817.     .db 14,6
  1818.     .db 3,6
  1819.  
  1820.     ;.db 16, 8
  1821.     .db %00001010, %00100101
  1822.     .db %00101101, %10101000
  1823.     .db %00010110, %01011101
  1824.     .db %00101010, %10001010
  1825.     .db %00011111, %11011011
  1826.     .db %00010110, %00101100
  1827.     .db %00010110, %11010100
  1828.     .db %00001110, %00100100
  1829.     .db 2,0
  1830.     .db 6,7
  1831.  
  1832.     ;.db 16, 8
  1833.     .db %00010101, %01001100
  1834.     .db %00010010, %10010010
  1835.     .db %00010101, %01101101
  1836.     .db %00010010, %11010110
  1837.     .db %00011101, %01101000
  1838.     .db %00010010, %10101010
  1839.     .db %00011111, %11111110
  1840.     .db %00000000, %00000000
  1841.     .db 4,5
  1842.     .db 2,0
  1843.  
  1844.     ;.db 16, 8
  1845.     .db %00001001, %00100000
  1846.     .db %00101110, %01110110
  1847.     .db %00011001, %10001010
  1848.     .db %00100101, %11110110
  1849.     .db %00001110, %10011010
  1850.     .db %00010110, %10010110
  1851.     .db %00000101, %01001010
  1852.     .db %00010100, %10100010
  1853.     .db 2,0
  1854.     .db 15,7
  1855.  
  1856. ;-----------Hard Levels--------------
  1857.  
  1858.     ;.db 16, 8
  1859.     .db %00010010, %10101101
  1860.     .db %00101001, %01010001
  1861.     .db %00010110, %10101111
  1862.     .db %00101011, %00010110
  1863.     .db %00010101, %10111101
  1864.     .db %00101010, %11101011
  1865.     .db %00010101, %01101101
  1866.     .db %00001010, %10100000
  1867.     .db 2,7
  1868.     .db 15,0
  1869.  
  1870.     ;.db 16, 8
  1871.     .db %00010001, %01010101
  1872.     .db %00100110, %01000101
  1873.     .db %00010001, %01010101
  1874.     .db %00100110, %01000101
  1875.     .db %00010001, %01010101
  1876.     .db %00100110, %01000101
  1877.     .db %00010001, %01010101
  1878.     .db %00001110, %01000101
  1879.     .db 2,7
  1880.     .db 15,6
  1881.  
  1882.     ;.db 16, 8
  1883.     .db %00100001, %11010000
  1884.     .db %00010110, %00101101
  1885.     .db %00111101, %11010110
  1886.     .db %00100101, %01010001
  1887.     .db %00011101, %11010110
  1888.     .db %00110110, %00111111
  1889.     .db %00000111, %11100010
  1890.     .db %00100000, %00001001
  1891.     .db 8,3
  1892.     .db 15,7
  1893.  
  1894.     ;.db 16, 8
  1895.     .db %00001110, %00000111
  1896.     .db %00011011, %01010100
  1897.     .db %00001110, %01010110
  1898.     .db %00000000, %01010100
  1899.     .db %00010100, %01010111
  1900.     .db %00101010, %01010000
  1901.     .db %00101010, %01010000
  1902.     .db %00101010, %00100000
  1903.     .db 5,1
  1904.     .db 15,0
  1905.  
  1906.     ;.db 16, 8
  1907.     .db %00110101, %01101000
  1908.     .db %00101010, %10111010
  1909.     .db %00100010, %01010100
  1910.     .db %00110101, %11100010
  1911.     .db %00011001, %01010110
  1912.     .db %00001010, %01011011
  1913.     .db %00011001, %11010101
  1914.     .db %00110110, %10111100
  1915.     .db 2,5
  1916.     .db 15,5
  1917.  
  1918.     ;.db 16, 8
  1919.     .db %00001000, %10001000
  1920.     .db %00101010, %10101010
  1921.     .db %00011010, %10101010
  1922.     .db %00101010, %10101010
  1923.     .db %00001010, %10101010
  1924.     .db %00011010, %10101010
  1925.     .db %00100010, %10101010
  1926.     .db %00000010, %00100011
  1927.     .db 2,0
  1928.     .db 15,7
  1929.  
  1930.     ;.db 16, 8
  1931.     .db %00001010, %00101011
  1932.     .db %00010111, %00101000
  1933.     .db %00101010, %10101110
  1934.     .db %00011100, %01101101
  1935.     .db %00100111, %10101001
  1936.     .db %00001010, %10101010
  1937.     .db %00101011, %00101010
  1938.     .db %00010100, %10101110
  1939.     .db 2,0
  1940.     .db 15,0
  1941.  
  1942.     ;.db 16, 8
  1943.     .db %00000110, %01010000
  1944.     .db %00011001, %00010110
  1945.     .db %00100101, %10101100
  1946.     .db %00011010, %01001101
  1947.     .db %00110011, %01101010
  1948.     .db %00010101, %01010101
  1949.     .db %00001010, %11101010
  1950.     .db %00010110, %10110101
  1951.     .db 2,0
  1952.     .db 15,7
  1953.  
  1954.     ;.db 16, 8
  1955.     .db %00000101, %00001010
  1956.     .db %00001010, %10100001
  1957.     .db %00010101, %01111111
  1958.     .db %00010100, %11100001
  1959.     .db %00010011, %10101110
  1960.     .db %00011110, %10101000
  1961.     .db %00001010, %10101011
  1962.     .db %00111000, %01010010
  1963.     .db 15,7
  1964.     .db 2,7
  1965.  
  1966.     ;.db 16, 8
  1967.     .db %00111011, %10101011
  1968.     .db %00111001, %00111010
  1969.     .db %00000001, %00101011
  1970.     .db %00110000, %00000010
  1971.     .db %00100100, %10110011
  1972.     .db %00110110, %10101000
  1973.     .db %00100101, %10101011
  1974.     .db %00110100, %10110011
  1975.     .db 2,2
  1976.     .db 14,6
  1977.  
  1978.  
  1979.  
  1980. ;**********************
  1981. ;*--Variables / Data--*
  1982. ;**********************
  1983.  
  1984. CharTable:    .db 'X','T','O','J','E', 0 , 0 ,' ','W','S','N','I','D'
  1985.                         .db  0 , 0, 'Z','V','R','M','H','C', 0 , 0 ,'Y','U','Q'
  1986.                         .db 'L','G','B', 0 , 0 , 0 ,'-','P','K','F','A'
  1987.  
  1988. Times:            .db 95,85,80,75,70,70,70,65,60,70        ;these are the time limits
  1989.                         .db 45,45,50,25,50,30,40,30,30,60        ;they go in order (1st 1 for
  1990.                         .db 30,20,40,15,35,30,30,25,25,60        ;level 1 & last for level 30
  1991.  
  1992. Bonuses:        .db 30,30,30,45,40,40,45,45,55,100        ;same for the bonuses
  1993.                         .db 40,53,50,50,40,35,45,50,50,100
  1994.                         .db 35,30,35,25,35,65,30,35,40,100
  1995.  
  1996. HighScore:
  1997.                         .db "Goofy............",0
  1998. HighScoreE:    .dw 400
  1999.                         .db "Donald Duck......",0
  2000. HighScoreM:    .dw 200
  2001.                         .db "Mickey Mouse.....",0
  2002. HighScoreH:    .dw 100
  2003.  
  2004. Skill:            .db 0            ;this is the skill level, when you pass a level or get
  2005.                                             ;a highscore it will be saved with the scores
  2006.  
  2007. Defaults:
  2008.     .db "Goofy............",0
  2009.     .dw 400
  2010.     .db "Donald Duck......",0
  2011.     .dw 200
  2012.     .db "Mickey Mouse.....",0
  2013.     .dw 100
  2014.     .db 0
  2015.  
  2016. ProgName:        .db $12,$07,"Blocked"        ;this is for the saving routine from tetris
  2017.                                                                         ;this way it can find the program in the memory
  2018.  
  2019. ;*********************
  2020. ;*------Strings------*
  2021. ;*********************
  2022.  
  2023. Clear?:                .db "  Clear High Scores  "
  2024.                             .db " and Skill Level?!?! ",0
  2025.                             .db "Yes  No              ",0
  2026.  
  2027. SideBar:
  2028.                             .db "Levl",0
  2029.                             .db "Scor",0
  2030.                             .db "Bnus",0
  2031.                             .db "Time",0
  2032.  
  2033. TitleText:
  2034.                             .db "                     "
  2035.                             .db "     BLOCKED  IN     "
  2036.                             .db "       ver 1.3       "
  2037.                             .db "                     "
  2038.                             .db "                     "
  2039.                             .db "  View High          "
  2040.                             .db "    Scores           "
  2041.                             .db "Start |  Help    Exit",0
  2042.  
  2043. Skill_Level:
  2044.                             .db "Choose a skill Level-",0
  2045.                             .db "Easy-----------------",0
  2046.                             .db "Easy---Medium--------",0
  2047.                             .db "Easy---Medium----Hard",0
  2048.  
  2049. Paused:
  2050.                             .db " Paused - Press any  "
  2051.                             .db "   key to resume.",0
  2052.  
  2053. Congrats:            .db "  Congratulations!   "
  2054.                             .db "   You Passed The    ",0
  2055.                             .db "    Easy Levels!     ",0
  2056.                             .db "   Medium Levels!    ",0
  2057.                             .db "    Hard Levels!     "
  2058.                             .db "Nearly IMPOSSIBLE!!!!",0
  2059.  
  2060. C_Score:            .db "Your Score Was--",0
  2061.  
  2062. NewHS:                .db "You Hold The New High"
  2063.                             .db "Score!!              "
  2064.                             .db "Enter Your Name--",0
  2065.  
  2066. HelpText;
  2067.                             .db "How  To  Play:",0
  2068.                             .db "          Use  the  arrow  keys  to  move  the",0
  2069.                             .db "man  and  push  the  blocks  out  of  the",0
  2070.                             .db "way  so  you  can  reach  the  goal",0
  2071.                             .db "(Black circle).   You  may  only  push",0
  2072.                             .db " one  block  at  a  time.  Second  resets",0
  2073.                             .db "the  blocks,  more  pauses.",0
  2074.                             .db " ",0
  2075.                             .db "         Send Q's and Comments to:",0
  2076.                             .db "                                     puzzlesome@hotmail.com",0
  2077.  
  2078. HighScoreText:
  2079.     .db "     High Scores     "
  2080.     .db " Easy Levels--       ",0
  2081.     .db " Medium Levels--     ",0
  2082.     .db " Hard Levels--       ",0
  2083.     .db "                     ",0
  2084.  
  2085. TimeUP:        .db "!Time UP!",0
  2086.  
  2087. .end
  2088.