diff --git a/games/tfv/Makefile b/games/tfv/Makefile index 929ceab5..a3902e75 100644 --- a/games/tfv/Makefile +++ b/games/tfv/Makefile @@ -31,7 +31,7 @@ HELLO: hello.bas LOADER: loader.o ld65 -o LOADER loader.o -C ../../linker_scripts/apple2_1000.inc -loader.o: loader.s init_vars.s common_defines.inc +loader.o: loader.s init_vars.s common_defines.inc zp.inc ca65 -o loader.o loader.s -l loader.lst ### @@ -39,7 +39,7 @@ loader.o: loader.s init_vars.s common_defines.inc TFV_TITLE: tfv_title.o ld65 -o TFV_TITLE tfv_title.o -C ../../linker_scripts/apple2_2000.inc -tfv_title.o: tfv_title.s \ +tfv_title.o: tfv_title.s zp.inc \ gr_vlin.s tfv_opener.s \ draw_menu.s keyboard.s joystick.s \ graphics_title/tfv_title.inc @@ -52,8 +52,7 @@ tfv_title.o: tfv_title.s \ TFV_FLYING: tfv_flying.o ld65 -o TFV_FLYING tfv_flying.o -C ../../linker_scripts/apple2_2000.inc -tfv_flying.o: tfv_flying.s \ - zp.inc \ +tfv_flying.o: tfv_flying.s zp.inc \ gr_putsprite.s \ help_flying.s \ flying_mode7.s flying_sprites.inc @@ -64,10 +63,10 @@ tfv_flying.o: tfv_flying.s \ TFV_WORLD: tfv_world.o ld65 -o TFV_WORLD tfv_world.o -C ../../linker_scripts/apple2_2000.inc -tfv_world.o: tfv_world.s \ +tfv_world.o: tfv_world.s zp.inc \ tfv_overworld.s tfv_drawmap.s tfv_battle.s \ help_overworld.s rotate_intro.s \ - graphics_map/tfv_backgrounds.inc tfv_sprites.inc zp.inc + graphics_map/tfv_backgrounds.inc tfv_sprites.inc ca65 -o tfv_world.o tfv_world.s -l tfv_world.lst graphics_map/tfv_backgrounds.inc: diff --git a/games/tfv/gr_putsprite_crop.s b/games/tfv/gr_putsprite_crop.s new file mode 100644 index 00000000..72fd8ab2 --- /dev/null +++ b/games/tfv/gr_putsprite_crop.s @@ -0,0 +1,359 @@ + ;============================================= + ; put_sprite_crop + ;============================================= + ; Sprite to display in INH,INL + ; Location is XPOS,YPOS + ; Note, only works if YPOS is multiple of two + + ; transparent color is $A (grey #2) + ; this means we can have black ($0) in a sprite + + ; FIXME: force YPOS to be even? + +put_sprite_crop: + + ldy #0 ; byte 0 is xsize ; 2 + lda (INL),Y ; 5 + sta CH ; xsize is in CH ; 3 + iny ; 2 + clc + adc XPOS + sta XMAX + + lda (INL),Y ; byte 1 is ysize ; 5 + sta CV ; ysize is in CV ; 3 + iny ; 2 + + lda YPOS ; make a copy of ypos ; 3 + sta TEMPY ; as we modify it ; 3 + ;=========== + ; 28 +put_sprite_crop_loop: + sty TEMP ; save sprite pointer ; 3 + ldy TEMPY ; 3 + + bpl put_sprite_crop_pos ; if < 0, skip to next + + clc ; skip line in sprite too + lda TEMP + adc CH + tay + + bne crop_increment_y + +put_sprite_crop_pos: + +psc_smc1: + cpy #48 ; bge if >= 48, done sprite + bcs crop_sprite_done + + + lda gr_offsets,Y ; lookup low-res memory address ; 4 + clc ; 2 + adc XPOS ; add in xpos ; 3 + sta OUTL ; store out low byte of addy ; 3 + clc ; never wraps, handle negative + lda gr_offsets+1,Y ; look up high byte ; 4 + adc DRAW_PAGE ; ; 3 + sta OUTH ; and store it out ; 3 + ldy TEMP ; restore sprite pointer ; 3 + + ; OUTH:OUTL now points at right place + + ldx XPOS ; load xposition into x ; 3 + ;=========== + ; 34 +crop_put_sprite_pixel: + lda (INL),Y ; get sprite colors ; 5 + iny ; increment sprite pointer ; 2 + sty TEMP ; save sprite pointer ; 3 + + + cpx #0 ; if off-screen left, skip draw + bmi skip_drawing + cpx #40 + bcs skip_drawing ; if off-screen right, skip draw + + ldy #$0 ; 2 + + ; check if completely transparent + ; if so, skip + + cmp #$aa ; if all zero, transparent ; 2 + beq crop_put_sprite_done_draw ; don't draw it ; 2nt/3 + ;============== + ; 16/17 + + sta COLOR ; save color for later ; 3 + + ; check if top pixel transparent + + and #$f0 ; check if top nibble zero ; 2 + cmp #$a0 + bne crop_put_sprite_bottom ; if not skip ahead ; 2nt/3 + ;============== + ; 7/8 + + lda COLOR + and #$0f + sta COLOR + + lda #$f0 ; setup mask ; 2 + sta MASK ; 3 + bmi crop_put_sprite_mask ; always? ; 3 + ;============= + ; 8 + +crop_put_sprite_bottom: + lda COLOR ; re-load color ; 3 + and #$0f ; check if bottom nibble zero ; 2 + cmp #$0a + bne crop_put_sprite_all ; if not, skip ahead ; 2nt/3 + ;============= + ; 7/8 + + lda COLOR + and #$f0 + sta COLOR + lda #$0f ; 2 + sta MASK ; setup mask ; 3 + ;=========== + ; 5 + +crop_put_sprite_mask: + lda (OUTL),Y ; get color at output ; 5 + and MASK ; mask off unneeded part ; 3 + ora COLOR ; or the color in ; 3 + sta (OUTL),Y ; store it back ; 6 + + jmp crop_put_sprite_done_draw ; we are done ; 3 + ;=========== + ; 20 + +crop_put_sprite_all: + lda COLOR ; load color ; 3 + sta (OUTL),Y ; and write it out ; 6 + ;============ + ; 9 + +crop_put_sprite_done_draw: +skip_drawing: + + ldy TEMP ; restore sprite pointer ; 3 + + inc OUTL ; increment output pointer ; 5 + inx ; increment x counter ; 2 + cpx XMAX + bne crop_put_sprite_pixel ; if not done, keep looping ; 2nt/3 + ;============== + ; 12/13 +crop_increment_y: + + inc TEMPY ; each line has two y vars ; 5 + inc TEMPY ; 5 + dec CV ; decemenet total y count ; 5 + bne put_sprite_crop_loop ; loop if not done ; 2nt/3 + ;============== + ; 17/18 +crop_sprite_done: + rts ; return ; 6 + + + +; 0,0 = 400+0 +; -1,0 = 400+ff=4ff, inc=400 + +; sprite: 5x4 +; +; -2,0 Xstart=0, sprite_offset=2, xsize=3 +; -1,0, Xstart=0, sprite_offset=1, xsize=4 +; 0,0, Xstrat=0, sprite_offset=0, xsize=5 +; 1,0, Xstart=1, sprite_offset=0, xsize=5 +; +; 39,0 Xstart=39, sprite_offset=0, xsize=1 +; +; +; +; + + +.if 0 + ;============================================= + ; put_sprite_flipped_crop + ;============================================= + ; Sprite to display in INH,INL + ; Location is XPOS,YPOS + ; Note, only works if YPOS is multiple of two + + ; transparent color is $A (grey #2) + ; this means we can have black ($0) in a sprite + + +put_sprite_flipped_crop: + + ldy #0 ; byte 0 is xsize ; 2 + lda (INL),Y ; 5 + sta CH ; xsize is in CH ; 3 + iny ; 2 + + + lda (INL),Y ; byte 1 is ysize ; 5 + sta CV ; ysize is in CV ; 3 + dey ; make Y zero again ; 2 + + lda INH ; ??? + sta ppfc_smc+2 + clc + lda INL + adc #1 ; add one (not two) because X counts + ; from CH to 1 (not CH-1 to 0) + sta ppfc_smc+1 + bcc psfc16 + inc ppfc_smc+2 +psfc16: + + + lda YPOS ; make a copy of ypos ; 3 + + sta TEMPY ; as we modify it ; 3 + ;=========== + ; 28 + + + +put_spritefc_loop: +; sty TEMP ; save sprite pointer ; 3 + ldy TEMPY ; 3 + + bmi fcrop_increment_y ; if < 0, skip to next +psc_smc2: + cpy #48 ; bge if >= 48, done sprite + bcs fcrop_sprite_done + + + lda gr_offsets,Y ; lookup low-res memory address ; 4 + clc ; 2 + adc XPOS ; add in xpos ; 3 + sta OUTL ; store out low byte of addy ; 3 + lda gr_offsets+1,Y ; look up high byte ; 4 + clc + adc DRAW_PAGE ; ; 3 + sta OUTH ; and store it out ; 3 +; ldy TEMP ; restore sprite pointer ; 3 + + ; OUTH:OUTL now points at right place + + ldx CH ; load xsize into x ; 3 + ;=========== + ; 34 +put_spritefc_pixel: + + clc + txa ; want (CH-X-1)+XPOS + eor #$ff + adc CH + adc XPOS + + bmi cskip_drawing + cmp #40 + + bcs cskip_drawing ; if off-screen right, skip draw + +ppfc_smc: + lda $C000,X ; get sprite colors ; 5 +; iny ; increment sprite pointer ; 2 +; sty TEMP ; save sprite pointer ; 3 + ldy #$0 ; 2 + + ; check if completely transparent + ; if so, skip + + cmp #$aa ; if all zero, transparent ; 2 + beq put_spritefc_done_draw ; don't draw it ; 2nt/3 + ;============== + ; 16/17 + + sta COLOR ; save color for later ; 3 + + ; check if top pixel transparent + + and #$f0 ; check if top nibble zero ; 2 + cmp #$a0 + bne put_spritefc_bottom ; if not skip ahead ; 2nt/3 + ;============== + ; 7/8 + + lda COLOR + and #$0f + sta COLOR + + lda #$f0 ; setup mask ; 2 + sta MASK ; 3 + bmi put_spritefc_mask ; always? ; 3 + ;============= + ; 8 + +put_spritefc_bottom: + lda COLOR ; re-load color ; 3 + and #$0f ; check if bottom nibble zero ; 2 + cmp #$0a + bne put_spritefc_all ; if not, skip ahead ; 2nt/3 + ;============= + ; 7/8 + + lda COLOR + and #$f0 + sta COLOR + lda #$0f ; 2 + sta MASK ; setup mask ; 3 + ;=========== + ; 5 + +put_spritefc_mask: + lda (OUTL),Y ; get color at output ; 5 + and MASK ; mask off unneeded part ; 3 + ora COLOR ; or the color in ; 3 + sta (OUTL),Y ; store it back ; 6 + + jmp put_spritefc_done_draw ; we are done ; 3 + ;=========== + ; 20 + +put_spritefc_all: + lda COLOR ; load color ; 3 + sta (OUTL),Y ; and write it out ; 6 + ;============ + ; 9 + +put_spritefc_done_draw: +cskip_drawing: +; ldy TEMP ; restore sprite pointer ; 3 + + inc OUTL ; increment output pointer ; 5 + dex ; decrement x counter ; 2 + bne put_spritefc_pixel ; if not done, keep looping ; 2nt/3 + ;============== + ; 12/13 +fcrop_increment_y: + inc TEMPY ; each line has two y vars ; 5 + inc TEMPY ; 5 + + lda CH + clc + adc ppfc_smc+1 + sta ppfc_smc+1 + bcc psfco + inc ppfc_smc+2 +psfco: + + dec CV ; decemenet total y count ; 5 + beq fcrop_sprite_done ; loop if not done ; 2nt/3 + jmp put_spritefc_loop + ;============== + ; 17/18 + +fcrop_sprite_done: + rts ; return ; 6 + + +.endif diff --git a/games/tfv/tfv_battle.s b/games/tfv/tfv_battle.s index 5a68b39a..cb9d4828 100644 --- a/games/tfv/tfv_battle.s +++ b/games/tfv/tfv_battle.s @@ -4,9 +4,13 @@ do_battle: + lda #34 + sta HERO_X + lda #0 + sta HERO_STATE + ; int i,ch; ; int saved_drawpage; -; int ax=34; ; int enemy_count=30; ; int old; @@ -25,69 +29,184 @@ do_battle: ; enemy_hp=enemies[enemy_type].hp_base+ ; (rand()&enemies[enemy_type].hp_mask); +.endif - saved_drawpage=ram[DRAW_PAGE]; + ;========================== + ; Draw background - ram[DRAW_PAGE]=PAGE2; + ;========================== + ; Draw sky + + ldx #0 ; blue from 0 .. 10 +battle_sky_loop: + lda gr_offsets,X + sta GBASL + lda gr_offsets+1,X + clc + adc #$8 ; store to $C00 + sta GBASH + + lda #$66 ; COLOR_MEDIUMBLUE + ldy #0 +battle_sky_inner: + sta (GBASL),Y + iny + cpy #40 + bne battle_sky_inner + + inx + inx + cpx #10 + bne battle_sky_loop + + + ; green from 10 .. 40 +battle_ground_loop: + lda gr_offsets,X + sta GBASL + lda gr_offsets+1,X + clc + adc #$8 ; store to $C00 + sta GBASH + + lda #$CC ; COLOR_LIGHTGREEN + ; FIXME: should be GROUNDCOLOR + ldy #0 +battle_ground_inner: + sta (GBASL),Y + iny + cpy #40 + bne battle_ground_inner + + inx + inx + cpx #40 + bne battle_ground_loop + + ; Draw some background images for variety? + + jsr draw_battle_bottom + +main_battle_loop: + + jsr gr_copy_to_current + + ;======================================== + ; draw our hero + ;======================================== + + lda HERO_HP + beq battle_draw_hero_down + + lda HERO_STATE + and #HERO_STATE_RUNNING + bne battle_draw_hero_running + + jmp battle_draw_normal_hero + +battle_draw_hero_down: + ; grsim_put_sprite(tfv_defeat,ax-2,24); + + lda HERO_X + sec + sbc #2 + sta XPOS + lda #24 + sta YPOS + + lda #tfv_defeat_sprite + + jmp battle_actual_draw_hero + +battle_draw_hero_running: + + ; grsim_put_sprite(tfv_stand_right,ax,20); + ; grsim_put_sprite(tfv_walk_right,ax,20); + + lda HERO_X + sta XPOS + lda #20 + sta YPOS + + lda FRAMEL + and #$8 + beq battle_draw_running_walk + +battle_draw_running_stand: + lda #tfv_stand_right_sprite + jmp battle_actual_draw_hero + +battle_draw_running_walk: + lda #tfv_walk_right_sprite + jmp battle_actual_draw_hero + +battle_draw_normal_hero: + ; grsim_put_sprite(tfv_stand_left,ax,20); + lda HERO_X + sta XPOS + lda #20 + sta YPOS + + lda #tfv_stand_left_sprite + sta INH + + jsr put_sprite_crop + +battle_draw_normal_sword: + ; grsim_put_sprite(tfv_led_sword,ax-5,20); + lda HERO_X + sec + sbc #5 + sta XPOS + lda #20 + sta YPOS + + lda #tfv_led_sword_sprite + +battle_actual_draw_hero: + sta INH + jsr put_sprite_crop - ;******************/ - ; Draw background */ - - ; Draw sky */ - color_equals(COLOR_MEDIUMBLUE); - for(i=0;i<10;i++) { - hlin_double(ram[DRAW_PAGE],0,39,i); - } - - ; Draw ground */ - color_equals(ground_color); - for(i=10;i<40;i++) { - hlin_double(ram[DRAW_PAGE],0,39,i); - } - - ; Draw some background images for variety? */ - - ram[DRAW_PAGE]=saved_drawpage; - - draw_battle_bottom(enemy_type); - - while(1) { - - gr_copy_to_current(0xc00); - - if (hp==0) { - grsim_put_sprite(tfv_defeat,ax-2,24); - } - else if (running) { -; if (battle_count%2) { - grsim_put_sprite(tfv_stand_right,ax,20); - } - else { - grsim_put_sprite(tfv_walk_right,ax,20); - } - } - else { - grsim_put_sprite(tfv_stand_left,ax,20); - grsim_put_sprite(tfv_led_sword,ax-5,20); - } +battle_done_draw_hero: ; grsim_put_sprite(enemies[enemy_type].sprite,enemy_x,20); - draw_battle_bottom(enemy_type); + jsr draw_battle_bottom - page_flip(); + jsr page_flip - if (hp==0) { - for(i=0;i<15;i++) usleep(100000); - break; - } - usleep(100000); - ch=grsim_input(); - if (ch=='q') return 0; + + ; pause if dead + + ; if (hp==0) { + ; for(i=0;i<15;i++) usleep(100000); + ; break; + ; } + + ; delay for framerate + ; usleep(100000); + + ; check keypress + + jsr get_keypress + cmp #'Q' + beq done_battle + +.if 0 if (enemy_count==0) { ; attack and decrement HP @@ -128,15 +247,16 @@ do_battle: } - - ram[DRAW_PAGE]=PAGE0; - clear_bottom(); - ram[DRAW_PAGE]=PAGE1; - clear_bottom(); - - running=0; .endif + jmp main_battle_loop + +done_battle: + + jsr clear_bottoms + + ; running=0; ? + rts .if 0 @@ -359,277 +479,290 @@ static int menu_state=MENU_NONE; static int menu_position=0; static int battle_count=0; -static int draw_battle_bottom(int enemy_type) { - int i; +.endif - clear_bottom(); +battle_enemy_string: +.byte 0,21,"KILLER CRAB",0 +battle_enemy_attack_string: +.byte 1,23,"PINCHING",0 - vtab(22); - htab(1); - move_cursor(); -; print(enemies[enemy_type].name); +battle_name_string: +.byte 14,21,"DEATER",0 - if (enemy_attacking) { - vtab(24); - htab(2); - move_cursor(); +; static int draw_battle_bottom(int enemy_type) { +draw_battle_bottom: + + jsr clear_bottom + + + ; print(enemies[enemy_type].name); + lda #battle_enemy_string + sta OUTH + jsr move_and_print + + +; if (enemy_attacking) { ; print_inverse(enemies[enemy_type].attack_name); - } +; } - vtab(22); - htab(15); - move_cursor(); - ; should print "NAMEO" -; print("DEATER"); - print(nameo); + ; print name string + lda #battle_name_string + sta OUTH + jsr move_and_print - if (susie_out) { - vtab(23); - htab(15); - move_cursor(); - print("SUSIE"); - } +; if (susie_out) { +; vtab(23); +; htab(15); +; move_cursor(); +; print("SUSIE"); +; } - if (menu_state==MENU_NONE) { +; if (menu_state==MENU_NONE) { +; +; ; TFV Stats */ +; +; vtab(21); +; htab(25); +; move_cursor(); +; print("HP"); +; +; vtab(21); +; htab(28); +; move_cursor(); +; print("MP"); - ; TFV Stats */ +; vtab(21); +; htab(31); +; move_cursor(); +; print("TIME"); - vtab(21); - htab(25); - move_cursor(); - print("HP"); - - vtab(21); - htab(28); - move_cursor(); - print("MP"); - - vtab(21); - htab(31); - move_cursor(); - print("TIME"); - - vtab(21); - htab(36); - move_cursor(); - if (limit<4) { - print("LIMIT"); - } - else { - ; Make if flash? set bit 0x40 */ - print_flash("LIMIT"); - } +; vtab(21); +; htab(36); +; move_cursor(); +; if (limit<4) { +; print("LIMIT"); +; } +; else { +; ; Make if flash? set bit 0x40 */ +; print_flash("LIMIT"); +; } - vtab(22); - htab(24); - move_cursor(); - print_byte(hp); +; vtab(22); +; htab(24); +; move_cursor(); +; print_byte(hp); - vtab(22); - htab(27); - move_cursor(); - print_byte(mp); +; vtab(22); +; htab(27); +; move_cursor(); +; print_byte(mp); ; Draw Time bargraph */ ; printf("Battle_bar=%d Limit=%d\n",battle_bar,limit); - ram[COLOR]=0xa0; - hlin_double(ram[DRAW_PAGE],30,34,42); - ram[COLOR]=0x20; - if (battle_bar) { - hlin_double(ram[DRAW_PAGE],30,30+(battle_bar-1),42); - } +; ram[COLOR]=0xa0; +; hlin_double(ram[DRAW_PAGE],30,34,42); +; ram[COLOR]=0x20; +; if (battle_bar) { +; hlin_double(ram[DRAW_PAGE],30,30+(battle_bar-1),42); +; } - ; Draw Limit break bargraph */ - ram[COLOR]=0xa0; - hlin_double(ram[DRAW_PAGE],35,39,42); +; ; Draw Limit break bargraph */ +; ram[COLOR]=0xa0; +; hlin_double(ram[DRAW_PAGE],35,39,42); - ram[COLOR]=0x20; - if (limit) hlin_double(ram[DRAW_PAGE],35,35+limit,42); +; ram[COLOR]=0x20; +; if (limit) hlin_double(ram[DRAW_PAGE],35,35+limit,42); - ; Susie Stats */ - if (susie_out) { +; ; Susie Stats */ +; if (susie_out) { +; +; vtab(23); +; htab(24); +; move_cursor(); +; print_byte(255); +; +; vtab(23); +; htab(27); +; move_cursor(); +; print_byte(0); +;#if 0 +; ; Draw Time bargraph */ +; ram[COLOR]=0xa0; +; hlin_double(ram[DRAW_PAGE],30,34,42); +; ram[COLOR]=0x20; +; if (battle_bar) { +; hlin_double(ram[DRAW_PAGE],30,30+(battle_bar-1),42); +; } +; +; ; Draw Limit break bargraph */ +; ram[COLOR]=0xa0; +; hlin_double(ram[DRAW_PAGE],35,39,42); +; +; ram[COLOR]=0x20; +; if (limit) hlin_double(ram[DRAW_PAGE],35,35+limit,42); +;#endif +; } +; } - vtab(23); - htab(24); - move_cursor(); - print_byte(255); - - vtab(23); - htab(27); - move_cursor(); - print_byte(0); -#if 0 - ; Draw Time bargraph */ - ram[COLOR]=0xa0; - hlin_double(ram[DRAW_PAGE],30,34,42); - ram[COLOR]=0x20; - if (battle_bar) { - hlin_double(ram[DRAW_PAGE],30,30+(battle_bar-1),42); - } - - ; Draw Limit break bargraph */ - ram[COLOR]=0xa0; - hlin_double(ram[DRAW_PAGE],35,39,42); - - ram[COLOR]=0x20; - if (limit) hlin_double(ram[DRAW_PAGE],35,35+limit,42); -#endif - } - } - - if (menu_state==MENU_MAIN) { - - if (limit>3) { - if (menu_position>5) menu_position=5; - } - else { - if (menu_position>4) menu_position=4; - } - - vtab(21); - htab(24); - move_cursor(); - if (menu_position==0) print_inverse("ATTACK"); - else print("ATTACK"); - - vtab(22); - htab(24); - move_cursor(); - if (menu_position==2) print_inverse("MAGIC"); - else print("MAGIC"); - - vtab(23); - htab(24); - move_cursor(); - if (menu_position==4) print_inverse("SUMMON"); - else print("SUMMON"); - - vtab(21); - htab(32); - move_cursor(); - if (menu_position==1) print_inverse("SKIP"); - else print("SKIP"); - - vtab(22); - htab(32); - move_cursor(); - if (menu_position==3) print_inverse("ESCAPE"); - else print("ESCAPE"); - - if (limit>3) { - vtab(23); - htab(32); - move_cursor(); - if (menu_position==5) print_inverse("LIMIT"); - else print("LIMIT"); - } +; if (menu_state==MENU_MAIN) { +; +; if (limit>3) { +; if (menu_position>5) menu_position=5; +; } +; else { +; if (menu_position>4) menu_position=4; +; } +; +; vtab(21); +; htab(24); +; move_cursor(); +; if (menu_position==0) print_inverse("ATTACK"); +; else print("ATTACK"); +; +; vtab(22); +; htab(24); +; move_cursor(); +; if (menu_position==2) print_inverse("MAGIC"); +; else print("MAGIC"); +; +; vtab(23); +; htab(24); +; move_cursor(); +; if (menu_position==4) print_inverse("SUMMON"); +; else print("SUMMON"); +; +; vtab(21); +; htab(32); +; move_cursor(); +; if (menu_position==1) print_inverse("SKIP"); +; else print("SKIP"); +; +; vtab(22); +; htab(32); +; move_cursor(); +; if (menu_position==3) print_inverse("ESCAPE"); +; else print("ESCAPE"); +; +; if (limit>3) { +; vtab(23); +; htab(32); +; move_cursor(); +; if (menu_position==5) print_inverse("LIMIT"); +; else print("LIMIT"); +; } +; +; +; } +; if (menu_state==MENU_SUMMON) { +; +; if (menu_position>1) menu_position=1; +; +; vtab(21); +; htab(25); +; move_cursor(); +; print("SUMMONS:"); +; +; vtab(22); +; htab(25); +; move_cursor(); +; if (menu_position==0) print_inverse("METROCAT"); +; else print("METROCAT"); +; +; vtab(23); +; htab(25); +; move_cursor(); +; if (menu_position==1) print_inverse("VORTEXCN"); +; else print("VORTEXCN"); +; } +; if (menu_state==MENU_MAGIC) { +; +; if (menu_position>4) menu_position=4; +; +; vtab(21); +; htab(24); +; move_cursor(); +; print("MAGIC:"); +; +; vtab(22); +; htab(25); +; move_cursor(); +; if (menu_position==0) print_inverse("HEAL"); +; else print("HEAL"); +; +; vtab(23); +; htab(25); +; move_cursor(); +; if (menu_position==2) print_inverse("ICE"); +; else print("ICE"); +; +; vtab(24); +; htab(25); +; move_cursor(); +; if (menu_position==4) print_inverse("BOLT"); +; else print("BOLT"); +; +; vtab(22); +; htab(32); +; move_cursor(); +; if (menu_position==1) print_inverse("FIRE"); +; else print("FIRE"); +; +; vtab(23); +; htab(32); +; move_cursor(); +; if (menu_position==3) print_inverse("MALAISE"); +; else print("MALAISE"); +; +; } +; +; if (menu_state==MENU_LIMIT) { +; +; if (menu_position>2) menu_position=2; +; +; vtab(21); +; htab(24); +; move_cursor(); +; print("LIMIT BREAKS:"); +; +; vtab(22); +; htab(25); +; move_cursor(); +; if (menu_position==0) print_inverse("SLICE"); +; else print("SLICE"); +; +; vtab(23); +; htab(25); +; move_cursor(); +; if (menu_position==2) print_inverse("DROP"); +; else print("DROP"); +; +; vtab(22); +; htab(32); +; move_cursor(); +; if (menu_position==1) print_inverse("ZAP"); +; else print("ZAP"); +; } +; +; ; Draw inverse separator */ +; ram[COLOR]=0x20; +; for(i=40;i<50;i+=2) { +; hlin_double(ram[DRAW_PAGE],12,12,i); +; } +; - } - if (menu_state==MENU_SUMMON) { - if (menu_position>1) menu_position=1; + rts +.if 0 - vtab(21); - htab(25); - move_cursor(); - print("SUMMONS:"); - - vtab(22); - htab(25); - move_cursor(); - if (menu_position==0) print_inverse("METROCAT"); - else print("METROCAT"); - - vtab(23); - htab(25); - move_cursor(); - if (menu_position==1) print_inverse("VORTEXCN"); - else print("VORTEXCN"); - } - if (menu_state==MENU_MAGIC) { - - if (menu_position>4) menu_position=4; - - vtab(21); - htab(24); - move_cursor(); - print("MAGIC:"); - - vtab(22); - htab(25); - move_cursor(); - if (menu_position==0) print_inverse("HEAL"); - else print("HEAL"); - - vtab(23); - htab(25); - move_cursor(); - if (menu_position==2) print_inverse("ICE"); - else print("ICE"); - - vtab(24); - htab(25); - move_cursor(); - if (menu_position==4) print_inverse("BOLT"); - else print("BOLT"); - - vtab(22); - htab(32); - move_cursor(); - if (menu_position==1) print_inverse("FIRE"); - else print("FIRE"); - - vtab(23); - htab(32); - move_cursor(); - if (menu_position==3) print_inverse("MALAISE"); - else print("MALAISE"); - - } - - if (menu_state==MENU_LIMIT) { - - if (menu_position>2) menu_position=2; - - vtab(21); - htab(24); - move_cursor(); - print("LIMIT BREAKS:"); - - vtab(22); - htab(25); - move_cursor(); - if (menu_position==0) print_inverse("SLICE"); - else print("SLICE"); - - vtab(23); - htab(25); - move_cursor(); - if (menu_position==2) print_inverse("DROP"); - else print("DROP"); - - vtab(22); - htab(32); - move_cursor(); - if (menu_position==1) print_inverse("ZAP"); - else print("ZAP"); - } - - ; Draw inverse separator */ - ram[COLOR]=0x20; - for(i=40;i<50;i+=2) { - hlin_double(ram[DRAW_PAGE],12,12,i); - } - -; ram[DRAW_PAGE]=saved_page; - - return 0; -} static int enemy_hp=0,enemy_type=0,enemy_x=0; diff --git a/games/tfv/tfv_overworld.s b/games/tfv/tfv_overworld.s index 61b6a00c..1ef6eb6d 100644 --- a/games/tfv/tfv_overworld.s +++ b/games/tfv/tfv_overworld.s @@ -429,16 +429,16 @@ walking: bne walking_right ; if(!0) walk right walking_left: - lda #>tfv_walk_left + lda #>tfv_walk_left_sprite sta INH - lda #tfv_walk_right + lda #>tfv_walk_right_sprite sta INH - lda #tfv_stand_left + lda #>tfv_stand_left_sprite sta INH - lda #tfv_stand_right + lda #>tfv_stand_right_sprite sta INH - lda #