comparison menu.s68 @ 942:74bb286e6174

Draw button labels
author Michael Pavone <pavone@retrodev.com>
date Wed, 09 Mar 2016 08:14:05 -0800
parents c96647630320
children 05229aa23b00
comparison
equal deleted inserted replaced
941:c96647630320 942:74bb286e6174
608 ;y pos 608 ;y pos
609 move.w d6, d1 609 move.w d6, d1
610 ;width 610 ;width
611 move.w d7, d2 611 move.w d7, d2
612 bsr draw_button 612 bsr draw_button
613 addq #4, d6
614 613
615 movea.l a5, a6 614 movea.l a5, a6
616 bsr strlen 615 bsr strlen
617 movea.l a5, a6 616 movea.l a5, a6
618 lea (1, a5, d0.w), a5 617 lea (1, a5, d0.w), a5
619 ;TODO: draw string 618 ;x pos
619 move.w d7, d1
620 lsr.w #1, d1
621 add.w d5, d1
622 lsr.w #1, d0
623 sub.w d0, d1
624 ;y pos
625 move.w d6, d2
626 ;base attribute
627 ;FIXME: Change base attribute to use fixed width font
628 move.w #$206B, d0
629 bsr print_string_fixed
630
631 addq #3, d6
620 bra .drawloop 632 bra .drawloop
621 .done 633 .done
622 rts 634 rts
623 635
624 initial_regs: 636 initial_regs:
660 move.w #$222, (a0) 672 move.w #$222, (a0)
661 673
662 ;init scroll table 674 ;init scroll table
663 vdpaccess $0, VDP_VRAM_WRITE 675 vdpaccess $0, VDP_VRAM_WRITE
664 move.w #0, (a0) 676 move.w #0, (a0)
665 move.w #4, (a0) 677 move.w #0, (a0)
678
679 ;init vertical scroll RAM
680 vdpaccess $0, VDP_VSRAM_WRITE
681 move.w #-4, (a0)
682 move.w #0, (a0)
666 683
667 ;load tiles 684 ;load tiles
668 vdpaccess $800, VDP_VRAM_WRITE 685 vdpaccess $800, VDP_VRAM_WRITE
669 lea font(pc), a2 686 lea font(pc), a2
670 move.w #((buttonend-font)/4 - 1), d0 687 move.w #((buttonend-font)/4 - 1), d0
715 move.w #(64*64-1), d1 732 move.w #(64*64-1), d1
716 ploop: 733 ploop:
717 move.l d0, (a0) 734 move.l d0, (a0)
718 dbra d1, ploop 735 dbra d1, ploop
719 736
720 ;moveq #0, d0
721 ;moveq #26, d1
722 ;moveq #6, d2
723 ;bsr draw_button
724
725 move.l #$40860002, d3 737 move.l #$40860002, d3
726 move.l d3, (a1) 738 move.l d3, (a1)
727 move.l d3, base_cmd.w 739 move.l d3, base_cmd.w
728 740
729 moveq #4, d6 741 moveq #8, d6
730 lea main_menu(pc), a5 742 lea main_menu(pc), a5
731 bsr draw_menu 743 bsr draw_menu
732 bra gamepad_setup 744 bra gamepad_setup
745
746 ;init scroll table
747 vdpaccess $0, VDP_VRAM_WRITE
748 move.w #0, (a0)
749 move.w #4, (a0)
733 750
734 751
735 move.b #0, more_pages.w 752 move.b #0, more_pages.w
736 lea page_index.w, a3 753 lea page_index.w, a3
737 moveq #MAX_DISPLAY-1, d7 754 moveq #MAX_DISPLAY-1, d7
848 865
849 ;Prints a null-terminated string with a fixed width font 866 ;Prints a null-terminated string with a fixed width font
850 ;a6 - pointer to string 867 ;a6 - pointer to string
851 ;a0 - VDP data port 868 ;a0 - VDP data port
852 ;d0 - base tile attribute 869 ;d0 - base tile attribute
870 ;d1 - x col
871 ;d2 - y col
853 ; 872 ;
854 print_string_fixed: 873 print_string_fixed:
874 ;multiply x by 2
875 add.w d1, d1
876 ;multiply y by 128
877 lsl.w #7, d2
878 add.w d2, d1
879 add.w #$8000, d1
880 move.w d1, d2
881 and.w #$3FFF, d1
882 rol.w #2, d2
883 and.w #3, d2
884 ori.w #(VDP_VRAM_WRITE >> 16), d1
885 swap d1
886 move.w d2, d1
887 move.l d1, (a1)
855 .loop 888 .loop
856 moveq #0, d1 889 moveq #0, d1
857 move.b (a6)+, d1 890 move.b (a6)+, d1
858 beq .end 891 beq .end
859 add.w d0, d1 892 add.w d0, d1
896 dc.b 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 929 dc.b 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
897 dc.b 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1 930 dc.b 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1
898 931
899 main_menu: 932 main_menu:
900 dc.b "Load ROM", 0 933 dc.b "Load ROM", 0
934 dc.b "About", 0
901 dc.b "Exit", 0 935 dc.b "Exit", 0
902 dc.b 0 936 dc.b 0
903 937
904 pause_menu: 938 pause_menu:
905 dc.b "Resume", 0 939 dc.b "Resume", 0
906 dc.b "Load ROM", 0 940 dc.b "Load ROM", 0
907 dc.b "Save State", 0 941 dc.b "Save State", 0
908 dc.b "Load State", 0 942 dc.b "Load State", 0
943 dc.b "Exit", 0
909 dc.b 0 944 dc.b 0
910 945
911 rom_end: 946 rom_end: