;Diamonds Level Editor 2.0 ;by Jonah Cohen #include "TI86.inc" .org _asm_exec_ram nop jp start .dw 0 grayscale_counter = $-1 .dw title getkey: halt call _getcsc or a jr z,getkey ret vert_line ld b,62: ld de,16 vert_line_loop: ld a,c or (hl) ld (hl),a add hl,de djnz vert_line_loop sbc hl,de ret horiz_line: ld (hl),%01111111 ld bc,$0fff horiz_line_loop: inc hl ld (hl),c djnz horiz_line_loop res 0,(hl) ret MultHL: xor a cp h jr z,SetZero cp l jr z,SetZero push bc call _HTIMESL pop bc ret SetZero: ld hl,0 ret ; modified routine originally by Matthew Shepcar GetA: ld l,a ld h,0 GetHL: xor a ld de,-1 ld (_curRow),de push bc call $4a33 pop bc dec hl DiscardSpaces: ld a,(hl) inc hl cp ' ' jr z,DiscardSpaces dec hl ret DispAStatus: ld l,a ld h,0 ld c,$72: call GetHL push bc push hl ld bc,10 xor a cpir ;bc=9-size ld a,9 sub c pop hl pop bc add a,a ;multiply by 2 cpl add a,c ;center column ld c,a ;load into current column vputs: ld (_penCol),bc jp _vputs draw_spaces: ;display d spaces at (b,c) push af push bc push hl ld (_penCol),bc space_loop: push de call _VPUTBLANK ;display a space pop de dec d jr nz,space_loop pop hl pop bc pop af ret draw_level: ;display the level ld hl,current_level ld bc,$0202 ;start drawing at (2,2) level_loop: push hl ld h,(hl) ;get the current tile call put_brick ;draw the sprite pop hl ;restore map pointer inc hl ;go to next tile ld a,b add a,12 ld b,a cp 98 ;end of row jr nz,level_loop ;only jump if the row isn't complete ld b,2 ;draw at the left again ld a,c add a,6 ld c,a ;move location down a row cp 62 ;check if it's done jr nz,level_loop ;jump back to the top if not done ret check_level: ;nz if not a diamonds level rst 10h ;do a _findsym to get bde ret c call _DATA_SIZE_TO_DE call _GETB_AHL ;get first byte and hl->string now cp $dd ret nz inc hl ld a,(hl) ;get second byte dec a ;cp $01 ret vputs_center: push af push bc push hl ld (_penRow),a ;set pen row ld e,0 ;length get_size: ld a,(hl) ;get next byte or a ;check if a=0 jr z,got_size ;finished getting size push hl push de call _copycharmaps ;hl->size of char pop de ld a,(hl) ;get size add a,e ;add to cumulative length ld e,a ;save pop hl inc hl ;next byte jr get_size got_size: srl e ;divide by 2 ld a,64 ;center column sub e ;a=center column ld (_penCol),a pop hl ;retrieve start of text call _vputs ;print the text pop bc pop af ret invert_title: xor a call vputs_center ld de,$fc00 ; point to video ram ld b,112 invert_title_loop: ld a,(de) cpl ld (de),a inc de djnz invert_title_loop ret get_level_offset: ld a,(level_num) ld h,a ld l,42 ;size of each level call MultHL ld de,levels add hl,de ;hl->compressed level ret get_title: ld hl,enter_name call input_str ld a,l ld (varname+1),a ld bc,8 sbc hl,bc ld hl,name_too_long jr nc,error_getting_title ;too long xor a ld hl,varname+2 call _SET_ABS_DEST_ADDR call _MM_LDIR ld hl,varname rst 20h ;mov10toop1 rst 10h ;_findsym push af call _RAM_PAGE_1 pop af ret c ld hl,level_already_exists error_getting_title: ld a,$1b call vputs_center call getkey jr get_title get_description: ld hl,enter_description call input_str ld de,100 call _cphlde jr nc,get_description push hl inc a ld hl,description-$8000 call _SET_ABS_DEST_ADDR call _MM_LDIR call _RAM_PAGE_1 pop hl ld de,description add hl,de ld (hl),0 ret input_str: push hl ld hl,_ioPrompt ld b,21 fill_io: ld (hl),' ' inc hl djnz fill_io ;fill the entire ioprompt with 0's pop hl ;so the input is on the next line ld de,_ioPrompt call _strCopy ;copy the string ld a,' ' ld (de),a ;copy over null byte get_string: call _clrWindow ld a,$0c ld (_ASAP_IND),a res 4,(iy+9) set shiftAlpha,(iy+shiftFlags) set shiftALock,(iy+shiftFlags) ;alpha lock call _exec_pg3 bit 4,(iy+9) jr nz,get_string ;if they hit on, get string again call _runIndicOff res shiftAlpha,(iy+shiftFlags) res shiftALock,(iy+shiftFlags) rst 10h ;_findsym call _DATA_SIZE_TO_DE call _SET_ABS_SRC_ADDR ex de,hl xor a jp _SET_MM_NUM_BYTES start: call _runIndicOff call _flushAllMenus ld hl,int_start ld de,$f0f0 ld bc,int_end-int_start ldir ld hl,int_table ld (hl),$f0 ld de,int_table+1 inc b ldir ld a,int_table/256 ld i,a ld hl,clipboard ld (hl),4 inc hl ld (hl),4 inc hl ld b,80 call _CLRLP ;clear clipboard ld de,title_menu jp draw_menu new_level: call get_title call get_description ld hl,starting_highscore ld de,highscore ld bc,6 ldir ;copy initial highscore and initials ld hl,num_levels ld (hl),1 ;only 1 to start inc hl ld (hl),4 ;default starting coordinates inc hl ld (hl),4 inc hl ld b,40 call _CLRLP ;fill tilemap with 0's jp edit_level level_down: ld bc,_findAlphaUp & $ff jr get_level level_up: ld bc,$ff00+(_findAlphaDn & $ff) get_level: ld a,b ld (starting_name+2),a ld a,c ld (mode),a get_level_loop: ld de,temp_search_name call _MOVFROP1 xor a call _findAlphaUp mode = $-2 ld hl,_OP1+1 ld de,temp_search_name+1 call _pstrCmp jr z,reset_level call check_level jr nz,get_level_loop jr load_main_loop reset_level: ld hl,starting_name rst 20h jr get_level_loop load_level: ld hl,starting_name rst 20h ;copy starting varname to op1 find_first_level: rst 08h ;op1 to op2 xor a call _findAlphaUp ;search for string jr c,error_loading ;no strings call check_level jr z,load_main_loop ;valid level ;now we check if we're getting anywhere in this search ld hl,_OP1+1 ld de,_OP2+1 call _pstrCmp ;see if name has changed jr nz,find_first_level ;keep searching if name is changing error_loading: ld de,no_levels_found jp draw_menu ;no levels load_main_loop: call _clrScrn ld hl,load_level_txt call invert_title ld c,3 ld hl,_OP1+1 ld a,(hl) rra cpl add a,11 ld b,a ld (_curRow),bc call _putps call getkey cp K_EXIT jp z,quit dec a ;cp K_DOWN jr z,level_down cp K_UP-1 jr z,level_up cp K_SECOND-1 jr z,level_selected cp K_ENTER-1 jr nz,load_main_loop level_selected: ld de,varname call _MOVFROP1 ;save varname rst 10h ;_findsym call _DATA_SIZE_TO_DE ;de=size, ahl=bde+2 push de call _GET_DATA_SIZE_DE_INC call _SET_ABS_SRC_ADDR pop hl xor a call _SET_MM_NUM_BYTES ;size to copy inc a ld hl,highscore-$8000 call _SET_ABS_DEST_ADDR ;copy here for now call _MM_LDIR call _RAM_PAGE_1 ld hl,description call _strLength add hl,bc inc hl ;hl=byte past 0 ld a,(hl) ;get number of levels push hl ld h,a ld l,42 call MultHL ;get size inc hl push hl ld bc,num_levels add hl,bc ;hl->end of level data ex de,hl ;put in de pop bc ;retrieve size pop hl ;retrieve pointer to end of string add hl,bc ;now we have the end of the actual data inc bc ;include size byte lddr ;copy it rst 10h call nc,_delvar ;now delete the level (we recreate it upon exiting) edit_level: call _RAM_PAGE_1 xor a ld (level_num),a inc a ld (brick_mode),a ;white bricks to start ld a,$37 ld (using_ball),a ld bc,$0202 ld (brick_y),bc edit_new_screen: ;screen needs to be redrawn im 2 call _clrLCD ld hl,$fc10 push hl ld c,%01000000 call vert_line call horiz_line pop hl call horiz_line ld c,%00000010 call vert_line ld hl,$fc1c ld c,%00100000 call vert_line ld hl,row_table ld b,2 draw_rows: ld e,(hl) inc hl ld d,(hl) inc hl ex de,hl ld (hl),%00111111 inc l ld (hl),%11111111 inc l ld (hl),%11111111 inc l ld (hl),%11111110 ex de,hl djnz draw_rows ld hl,side_text ld b,4 vputs_loop: push bc ld c,(hl) inc hl ld b,(hl) inc hl call vputs pop bc djnz vputs_loop ld a,%01001000 ld ($ff1e),a ;down arrow ld hl,screen_dark ld de,screen_light ld bc,1024 ldir call draw_mode ld a,(using_ball) rla call nc,draw_cursor ;display cursor if we're not using the ball edit_new_level: ld bc,$0c6b ld d,b ;ld d,12 call draw_spaces ld a,(level_num) inc a ld b,$0c call DispAStatus call get_level_offset ;hl->compressed level ld de,current_coords ldi ldi ;copy starting coordinates ;decompress from hl to de ld b,40 ;40 bytes per level xor a decomp_level: rld ld (de),a inc de rld ld (de),a inc de inc hl djnz decomp_level call draw_level call draw_ball edit_main_loop: call compress_level ;save data call getkey cp K_ALPHA jp z,switch_mode cp K_F5 ld de,options_table jp z,draw_menu ;menu for options cp K_PLUS jp z,next_level cp K_MINUS jr z,last_level cp K_MORE jp z,paste cp K_CLEAR jp z,clear_level cp K_EXIT jp z,save cp K_XVAR jp z,insert_level cp K_DEL jp z,delete_level ld b,a ld a,(using_ball) rla ld a,%01111110 out (1),a in a,(1) jr c,check_ball check_brick: rra jp nc,move_brick_down rra jp nc,move_brick_left rra jp nc,move_brick_right rra jp nc,move_brick_up ld a,b cp K_SECOND jp z,change_brick sub K_F1 jp z,mode_down inc a ;cp K_F2 jp z,mode_up edit_main_loop_: jr edit_main_loop check_ball: rra jp nc,move_ball_down rra jp nc,move_ball_left rra jp nc,move_ball_right rra jp nc,move_ball_up jr edit_main_loop_ last_level: call draw_level ;erase the level call draw_ball ;erase the ball ld hl,level_num ld a,(hl) or a jr nz,not_first_level ld a,(num_levels) ld (hl),a not_first_level: dec (hl) jp edit_new_level next_level: call draw_level ;erase the level call draw_ball ;erase the ball ld hl,level_num inc (hl) ld a,(hl) ld hl,num_levels cp (hl) jp nz,edit_new_level ;we're loading an existing level ;create a new one ld a,(hl) cp 250 jr z,max_level inc (hl) ;another level call get_level_offset ld (hl),4 inc hl ld (hl),4 ;starting ball coordinates jr clear ;clear the level max_level: ld hl,level_num dec (hl) call draw_level call draw_ball jr edit_new_screen_ paste: call insert ld hl,clipboard ld de,current_coords call copy_clipboard jr edit_new_screen_ insert_level: call insert jr clear ;now clear the tiles clear_level: call cut clear: ld hl,current_level ld b,80 call _CLRLP ;fill with zeros edit_new_screen_: call compress_level ;save changes jp edit_new_screen cut: ld hl,current_coords ld de,clipboard copy_clipboard: ld bc,82 ldir ret switch_mode: call draw_mode call draw_cursor ld hl,using_ball rl (hl) ccf rr (hl) call draw_mode jr editmainloop mode_up: call draw_brick_mode ld hl,brick_mode inc (hl) ld a,(hl) cp 14 jr nz,finish_change_mode ld (hl),0 ;go back to start finish_change_mode: call draw_brick_mode jr editmainloop mode_down: call draw_brick_mode ld hl,brick_mode dec (hl) ld a,(hl) inc a ;cp -1 jr nz,finish_change_mode ld (hl),13 ;end byte jr finish_change_mode insert: ld a,(level_num) ld b,a ld a,(num_levels) cp 250 jr z,edit_new_screen_ sub b ld h,a ld l,42 call MultHL push hl ;save size to copy call get_level_offset pop bc ;retrieve size to copy add hl,bc ;add size of levels dec hl ld d,h ld e,l push bc ld bc,42 add hl,bc ;next level up pop bc ex de,hl lddr ;copy levels ld hl,num_levels inc (hl) ret change_brick: ld bc,(brick_y) push bc ;get the tile ld h,0 ld l,b ld a,12 push bc call _divHLbyA pop bc ld b,l ;store x value ld l,c ld a,6 ;divide by 6 push bc call _divHLbyA pop bc ld a,l ;a=y coordinate add a,a add a,a add a,a ;y*8 add a,b ;add to x ld hl,current_level ld e,a ld d,0 add hl,de ;get offset of tile pop bc ld a,(hl) ;code for tile push hl call draw_brick ;erase old brick pop hl ld a,(brick_mode) ld (hl),a ;set new brick type call draw_brick ;draw new brick editmainloop: jp edit_main_loop move_brick_down: ld hl,brick_y ld bc,56*256+6 jr move_brick move_brick_up: ld hl,brick_y ld bc,2*256+(256-6) jr move_brick move_brick_left: ld hl,brick_x ld bc,2*256+(256-12) jr move_brick move_brick_right: ld hl,brick_x ld bc,86*256+12 move_brick: ld a,(hl) cp b jr z,editmainloop push af push bc push hl call draw_cursor pop hl pop bc pop af add a,c ld (hl),a call draw_cursor jr editmainloop move_ball_down: ld hl,current_coords ld bc,57*256+1 jr move_ball move_ball_right: ld hl,current_coords+1 ld bc,93*256+1 jr move_ball move_ball_up: ld hl,current_coords jr move_ball_dec move_ball_left: ld hl,current_coords+1 move_ball_dec: ld bc,2*256+(256-1) move_ball: ld a,(hl) cp b jr z,editmainloop push af push bc push hl call draw_ball pop hl pop bc pop af add a,c ld (hl),a call draw_ball jr editmainloop compress_level: call get_level_offset ;hl->compressed level ld de,current_coords ex de,hl ldi ldi ;copy starting coordinates ex de,hl ld b,40 ;40 bytes per level ;compress from de to hl compress_loop: ld a,(de) rld ;copy 1 byte into lower chunk of hl inc de ld a,(de) rld ;move first byte up, copy next byte into lower chunk of hl inc de inc hl djnz compress_loop ret delete_level: call cut ld a,(level_num) ld b,a ld a,(num_levels) cp 1 jp z,edit_main_loop sub b ld h,a ld l,42 call MultHL push hl ;save size to copy call get_level_offset ld d,h ld e,l ld bc,42 add hl,bc pop bc ;retrieve size to copy ldir ;copy over current level ld hl,num_levels dec (hl) ld a,(hl) ld hl,level_num cp (hl) jr nz,reset_score dec (hl) reset_score: ld hl,starting_highscore ld de,highscore ld bc,6 ldir ;copy default highscore jr edit_new_scrn change_title: call get_title edit_new_scrn: jp edit_new_screen change_description: call get_description jr edit_new_scrn lookup_keys: call _clrLCD xor a ld hl,lookup_text ld b,9 lookup_loop: push af push bc call vputs_center pop bc pop af add a,7 djnz lookup_loop call getkey jp edit_new_screen save: ld hl,varname rst 20h ld hl,description call _strLength ld a,(num_levels) ld h,a ld l,42 call MultHL ;size of levels add hl,bc ;add length of description ld de,11 add hl,de ;# of levels+null terminator+indicator bytes+highscore stuff push hl ;save size ld hl,7 ;null byte+highscore+initials add hl,bc ld b,h ld c,l ld hl,highscore-1 add hl,bc ;hl->null byte at end of description ld de,num_levels-1 ;where we're copying to lddr ex de,hl ld (hl),$01 ;\ dec hl ; signature bytes ld (hl),$dd ;/ ld de,-$8000 ;normalize address add hl,de ex (sp),hl ;save new address, retrieve size call _CREATESTRNG call _DATA_SIZE_TO_DE ;past size bytes call _SET_ABS_DEST_ADDR xor a ex de,hl call _SET_MM_NUM_BYTES inc a pop hl call _SET_ABS_SRC_ADDR ;copy from here call _MM_LDIR ;copy string quit: res 4,(iy+9) xor a ld (_asapvar+1),a ;so it's recopied reset_screen: im 1 ld a,$7c out (0),a ;restore video mem jp _clrWindow draw_menu: push de call reset_screen pop hl ld c,(hl) ;number of entries inc hl call invert_title ;display title ld b,c ld a,$0e ;starting row draw_menuDTL: call vputs_center add a,9 djnz draw_menuDTL push hl ld b,1 call draw_menu_invert_bar draw_menu_loop: push bc call getkey pop bc cp K_UP jr z,draw_menu_up dec a jr z,draw_menu_down cp K_SECOND-1 jr z,draw_menu_selected cp K_ENTER-1 jr nz,draw_menu_loop draw_menu_selected: pop hl ld d,0 ld e,b dec e sla e add hl,de call $33 jp (hl) draw_menu_up: call draw_menu_invert_bar dec b jr nz,draw_menu_bar ld b,c jr draw_menu_bar draw_menu_down: call draw_menu_invert_bar ld a,c cp b jr z,draw_menu_downT inc b jr draw_menu_bar draw_menu_downT: ld b,1 draw_menu_bar: call draw_menu_invert_bar jr draw_menu_loop draw_menu_invert_bar: push hl push bc ld h,b ld l,9*16 call _HTIMESL ld de,$fc51 add hl,de call draw_menu_invert pop bc pop hl ret draw_menu_invert: ld c,7 ;# of rows draw_menu_invert_loop: ld b,14 ;14 bytes across draw_menu_flip_bits: ld a,(hl) cpl ld (hl),a inc hl djnz draw_menu_flip_bits inc hl inc hl ;skip 2 bytes dec c ;row counter jr nz,draw_menu_invert_loop ret draw_cursor: ld bc,(brick_y) ld ix,cursor jr put_sprite draw_mode: using_ball: scf jr c,draw_brick_mode draw_ball_status: ld bc,$6e22 jr put_ball draw_ball: ld bc,(current_coords) put_ball: ;bc=coords ld ix,ball jr put_sprite draw_brick_mode: ld a,(brick_mode) ld bc,$6a22 draw_brick: ld h,a put_brick: ;h=brick number, bc=coords ld l,24 call MultHL ld ix,bricks ;load the start of the sprites ex de,hl add ix,de ;add together to get correct sprite put_sprite: ;16x6 xor-ed grayscale putsprite ;ix=sprite ;b,c=(x,y) push bc ld h,$fc00/1024 ld a,c add a,a add a,a ld l,a ld a,b rra add hl,hl rra add hl,hl rra or l ld l,a ld a,b and 7 ld (bit_shift),a ld b,2 place_sprite: push bc ld b,6 draw_sprite: ld c,(ix) inc ix ld d,(ix) inc ix ld e,0 ld a,0 bit_shift = $-1 or a jr z,no_shift shift_bytes: srl c rr d rr e dec a jr nz,shift_bytes no_shift: ld a,c xor (hl) ld (hl),a inc hl ld a,d xor (hl) ld (hl),a inc hl ld a,e xor (hl) ld (hl),a ld de,14 add hl,de djnz draw_sprite ld de,screen_light-screen_dark-96 add hl,de pop bc djnz place_sprite pop bc ret int_start: ;from bomber bloke exx ex af,af' in a,(3) bit 3,a jr z,no_down_left_bug and %11111110 out (3),a no_down_left_bug: bit 1,a jr z,no_swap ld hl,grayscale_counter inc (hl) ld a,(hl) cp 3 ld a,(screen_dark/256)-$80 jr c,set_video_port ld a,(screen_light/256)-$80 ld (hl),0 set_video_port: out (0),a no_swap: jp $3a int_end: cursor: .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 ball: .db %01110000,0 .db %10111000,0 .db %11111000,0 .db %11111000,0 .db %01110000,0 .db %00000000,0 .db %01110000,0 .db %11011000,0 .db %10011000,0 .db %11111000,0 .db %01110000 bricks: ;start of bricks ;0 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 .db %00000000, %00000000 ;1 .db %01111111, %11100000 .db %10000000, %00010000 .db %10000000, %00010000 .db %10000000, %00010000 .db %10000000, %00010000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %01111111, %11100000 ;2 .db %01111111, %11100000 .db %10101010, %10110000 .db %11010101, %01010000 .db %10101010, %10110000 .db %11010101, %01010000 .db %01111111, %11100000 .db %01111111, %11100000 .db %10000000, %00010000 .db %10000000, %00010000 .db %11111111, %11110000 .db %11111111, %11110000 .db %01111111, %11100000 ;3 .db %01111111, %11100000 .db %10000000, %00010000 .db %10111111, %11010000 .db %10111111, %11010000 .db %10000000, %00010000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11111111, %11110000 .db %11100110, %01110000 .db %11100110, %01110000 .db %11111111, %11110000 .db %01111111, %11100000 ;4 .db %01111111, %11100000 .db %10100100, %10010000 .db %10010010, %01010000 .db %11001001, %00110000 .db %10100100, %10010000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11001001, %00110000 .db %10100100, %10010000 .db %10010010, %01010000 .db %11001001, %00110000 .db %01111111, %11100000 ;5 .db %01111111, %11100000 .db %11111111, %11110000 .db %11100000, %01110000 .db %11100000, %01110000 .db %11111111, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11000000, %00110000 .db %10000000, %00010000 .db %10000000, %00010000 .db %11000000, %00110000 .db %01111111, %11100000 ;6 .db %01111111, %11100000 .db %11111110, %00110000 .db %10000000, %10110000 .db %11001110, %00110000 .db %11111111, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11000001, %11110000 .db %11111111, %01010000 .db %10110001, %11010000 .db %11000000, %00110000 .db %01111111, %11100000 ;7 .db %01111111, %11100000 .db %11111001, %11110000 .db %11110110, %11110000 .db %11110000, %11110000 .db %11110000, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11000110, %00110000 .db %10001001, %00010000 .db %10001111, %00010000 .db %11001111, %00110000 .db %01111111, %11100000 ;8 .db %01111111, %11100000 .db %11100111, %11110000 .db %10000000, %00010000 .db %10000000, %00010000 .db %11100111, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11011000, %00110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11011000, %00110000 .db %01111111, %11100000 ;9 .db %01111111, %11100000 .db %11011110, %11110000 .db %11111011, %11110000 .db %11101111, %10110000 .db %11111101, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11100001, %00110000 .db %10000100, %00010000 .db %10010000, %01010000 .db %11000010, %00110000 .db %01111111, %11100000 ;10 .db %01111111, %11100000 .db %10101011, %11110000 .db %11010101, %11110000 .db %10101011, %11110000 .db %11010101, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %10000001, %11110000 .db %10000001, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %01111111, %11100000 ;11 .db %01111111, %11100000 .db %10000001, %11110000 .db %10111111, %11110000 .db %10111111, %11110000 .db %10000001, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11111111, %11110000 .db %11100111, %11110000 .db %11100111, %11110000 .db %11111111, %11110000 .db %01111111, %11100000 ;12 .db %01111111, %11100000 .db %10100101, %11110000 .db %10010011, %11110000 .db %11001001, %11110000 .db %10100101, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11001001, %11110000 .db %10100101, %11110000 .db %10010011, %11110000 .db %11001001, %11110000 .db %01111111, %11100000 ;13 .db %01111111, %11100000 .db %11111111, %10110000 .db %11011100, %00010000 .db %10000011, %10110000 .db %11011111, %11110000 .db %01111111, %11100000 .db %01111111, %11100000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %11111111, %11110000 .db %01111111, %11100000 title_menu: .db 3 ;main menu stuff title: .db "Diamonds Level Editor 2.0",0 .db "New level",0 .db "Load level",0 .db "Exit",0 .dw new_level .dw load_level .dw quit no_levels_found: .db 2 .db "No Diamonds levels found",0 .db "Create new level",0 .db "Exit",0 .dw new_level .dw quit options_table: .db 5 .db "Diamonds Level Editor Options",0 .db "Back to editor",0 .db "Controls",0 .db "Change level name",0 .db "Change level title",0 .db "Reset high score",0 .dw edit_new_screen .dw lookup_keys .dw change_title .dw change_description .dw reset_score enter_name: .db "Enter level name:",0 enter_description: .db "Enter level title:",0 load_level_txt: .db "Load Diamonds Level",0 name_too_long: .db "Cannot be more than 8 letters",0 level_already_exists: .db "Variable already exists",0 side_text: .db $67,$04,"Level",0 .db $68,$18,"Mode",0 .db $6b,$2d,"F5-",0 .db $65,$35,"Options",0 lookup_text: .db "Arrows - move cursor/ball",0 .db "2nd - place brick",0 .db "Alpha - switch to/from ball",0 .db "F1/F2 - brick mode down/up",0 .db "X-Var - insert level",0 .db "Clear - cut level",0 .db "Del - cut and delete level",0 .db "More - paste level",0 .db "Plus/Minus - navigate levels",0 starting_name: .db $0c,1,0 starting_highscore: .dw 0 \ .db "AAA",0 row_table: .dw $fd5c,$febc varname equ $ ;level name temp_search_name equ varname+11 int_table equ ((temp_search_name+11) | $ff)+1 screen_light equ $f700 screen_dark equ $fc00 level_num equ $8100 brick_mode equ level_num+1 ;type of brick we're using brick_y equ brick_mode+1 brick_x equ brick_y+1 current_coords equ brick_x+1 ;starting coordinates for current level (2 bytes) current_level equ current_coords+2 ;the level being edited (80 bytes) clipboard equ current_level+80 ;"cut" level (82 bytes) highscore equ clipboard+82 ;the highscore (2 bytes) initials equ highscore+2 ;initials (4 bytes) description equ initials+4 ;the description (100 bytes) num_levels equ description+100 levels equ num_levels+1 ;the actual levels .end