September 2009
M T W T F S S
« Aug   Oct »
 123456
78910111213
14151617181920
21222324252627
282930  

IC2005 Smart Shop

the source code for MD 3in1 Myth Cart menu v2.01

the source code for MD 3in1 Myth Cart menu v2.01

 

more info: http://www.neoflash.com/forum/index.php/topic,5794.0.html

;=================== the source code for MD 3in1 Myth Cart menu v2.01 ===================
;===================             Copy right by: Neo TeAm              ===================
;===================                www.NEOFLASH.com                  ===================
CARD   EQU     $0FFC000
CONT   EQU     $0FFC002
CONT2  EQU     $0FFC004
INA    EQU     $0FFC006

RBK_H  EQU     $0FFC010
RBK_L  EQU     $0FFC012
ROM_Z  EQU     $0FFC014
SRAM_M EQU     $0FFC016
MODE   EQU     $0FFC018
MODEA  EQU     $0FFC01A
RUN    EQU     $0FFC01C
PRAM_Z EQU     $0FFC020
MK3    EQU     $0FFC022
SAVE   EQU     $0FFC024
CPJOY  EQU     $0FFC030
NEO2   EQU     $0FFC034 ;32BIT
NEO2_C EQU     $0FFC038 ;32BIT
SPED   EQU     $0FFC03C
ERR    EQU     $0FFC03E

……

DASC   EQU     $0FFC100
ROM_S  EQU     $0FFC050
SR_B   EQU     $0FFC056
SR_Z   EQU     $0FFC058
MOVE_Z EQU     $0FFC05A
MOVP_Z EQU     $0FFC05C

;=================== IO ========================================================
OPTION_IO EQU     $0A13000
GBAC_LIO  EQU     $0A13002
GBAC_HIO  EQU     $0A13004
GBAC_ZIO  EQU     $0A13006
GBAS_BIO  EQU     $0A13008 ;GBA SRAM BANK
GBAS_ZIO  EQU     $0A1300A ;GBA SRAM SIZE
PRAM_BIO  EQU     $0A1300C
PRAM_ZIO  EQU     $0A1300E
RUN_IO    EQU     $0A13010
RST_IO    EQU     $0A13018
WE_IO     EQU     $0A13020
EXTM_ON   EQU     $0A13028
USB_ON    EQU     $0A13014

 

                ORG         $00
                include BOOT.DAT
                ORG         $208
START

                include STAR.DAT
                JMP   START1
Load_Tiles:
                move.w  #$8f02,$c00004
                move.l  #$40000000,$c00004

                lea     font(pc),a0
                move.w  #2880,d0
loadfont:
                move.w  (a0)+,$C00000
                dbra    d0,loadfont
                rts
font:
                include FONT1.DAT
START1:

                LEA       $008000,A0
                LEA       $FF0000,A1
                MOVE.W    #$4000,D0
^0              MOVE.W    (A0)+,(A1)+
                DBF       D0,<0
                JMP       $FF0000

                ORG         $FF0000
START2:
                clr.l   d1
                clr.l   d2
                move.b  #0,d1
                lea     MAKE1(PC),a0
                bsr     printz

                move.b  #2,d1
                lea     MAKE2(PC),a0
                bsr     printz

                move.b  #25,d1
                lea     MAKE0(PC),a0
                bsr     printz

                move.b  #18,d1
                lea     MAKE3(PC),a0
                bsr     printz

                JSR     CHECK_MENU
                MOVE.W  #$00,INA
                MOVE.B  #$00,SAVE
                JSR     TEST_NEO_CARD
                JMP     PRINTX

MENU:
                jsr     rjoy
                CMP.B   #$01,d0    ; 00 UP
                BEQ     PPU
                NOP

                CMP.B   #$02,d0    ; 01 DOWN
                BEQ     PPD
                NOP

                CMP.B   #$40,d0    ; 04 A
                BEQ     RUN_X0
                NOP

                CMP.B   #$10,d0    ;    B
                BEQ     RUN_X1
                NOP

                CMP.B   #$20,d0    ;    C
                BEQ     RUN_X3
                NOP
                             
                CMP.B   #$80,d0   ;    START
                BEQ     RUN_X4
                NOP

                Jmp     MENU

RUN_X4:
                lea      MAKE30(PC),a0  ;BBBB
                JSR      PRINTA
                JSR      wjoy
                MOVE.W   #$FFFF,D0
                MOVE.W   D0,USB_ON

RUN_X4A:
                jsr     rjoy
                NOP
                CMP.B   #$20,d0    ;    C
                BEQ     RUN_X5
                NOP
                NOP
                NOP
                NOP
                JMP     RUN_X4A

RUN_X5:

                lea      MAKE13(PC),a0  ;BBBB
                JSR      PRINTA
                JSR      wjoy
                MOVE.W   #$0000,D0
                MOVE.W   D0,USB_ON
                NOP
                NOP
                NOP
                NOP
                NOP
                NOP
                MOVE.B   #$00,MODE
;*******************************************************************************
                MOVE.B   #$0B,ROM_Z        ;
                MOVE.B   #$00,RBK_H        ; A24~A25
;*******************************************************************************
                MOVE.B   #$00,RBK_L
;*******************************************************************************
                MOVE.B   #$01,SR_Z;        ; GBA SRAM SIZE
                MOVE.B   #$00,SR_B         ; GBA SRAM BANK
;*******************************************************************************
                MOVE.B   #$06,RUN
;*******************************************************************************
                JMP      MD5
               
RUN_X1:

                lea      MAKE11(PC),a0  ;BBBB
                JSR      PRINTA
                JSR      wjoy

                CMP.B    #$02,MODE
                BNE      >0
                MOVE.B   #$01,MK3
^0
                JMP      RUN_X
               

               
RUN_X3:
                lea      MAKE13(PC),a0  ;CCCC
                JSR      PRINTA
                JSR      wjoy
                MOVE.B   #$00,MK3
                jmp      RUN_X

RUN_X0:

                JMP      MENU   ;;;; TEST
               
                lea      MAKE13(PC),a0  ;AAAA
                JSR      PRINTA
                JSR      wjoy
                jmp      TEST_A25
;===============================================================================
CHECK_MENU:
                MOVE.W  #$01,CONT2
                MOVE.W  #$00,CARD
                lea     ms0,a0
                MOVE.B  (A0),D0
                CMP.B   #$FF,D0
                BEQ     >0
                JMP     >2
^3
                MOVE.B  (A0),D0
                CMP.B   #$FF,D0
                BEQ     >1
^2
                ADD     #$01,CARD
                ADD     #$20,A0
                JMP     <3

^1
                SUB     #$01,CARD
^0
                RTS
;===============================================================================
RUN_X:
;              ;LEA       BOOT_X,A0
;
;               LEA      $000000,A0
;               LEA      $FF8000,A1
;               MOVE.W   #$1000,D0
;^0             MOVE.W   (A0)+,(A1)+
;               DBF       D0,<0
;               JMP      BOOT_X+$FF8000
              
                JMP      BOOT_X

BOOT_X:
                nop
                nop

;               MOVE.L   #$00,D0
;               MOVE.L   #$00,A0
;
;               MOVE.W   #$0057,D0     ; SET SW
;               MOVE.W   D0,$A13018
;
;               MOVE.W   #$0063,D0     ; SET SW
;               MOVE.W   D0,$A13018
;
;               MOVE.W   #$0045,D0     ; SET SW
;               MOVE.W   D0,$A13018
;
;               MOVE.W   #$00A9,D0     ; SET SW
;               MOVE.W   D0,$A13018

               MOVE.W   #$0000,OPTION_IO    ; SET MODE0
              
;              MOVE.L   #$00372203,NEO2_C   ; SET GAME ROM
;===============================================================================
               MOVE.L   #$00370203,NEO2_C   ; SET GAME ROM  >> old
               JSR      NEO_CMD
;              MOVE.L   #$00DAAE44,NEO2_C   ; SET X2 ROM    >>old
              
               JSR      NEO_CMD
               MOVE.L   #$00EE0630,NEO2_C   ; SET 1G ROM
               JSR      NEO_CMD
               MOVE.W   #$FFFF,EXTM_ON      ; ON A24,A25 TO PIN
                            
                                
               CMP.B   #$02,MODE            ; MK4
               BNE     MD5

               CMP.B   #$01,ROM_Z
               BNE     >1
               MOVE.B   #$FF,PRAM_Z
               JMP     >3
^1

               CMP.B   #$02,ROM_Z
               BNE     >1
               MOVE.B   #$FE,PRAM_Z
               JMP     >3
^1
               CMP.B   #$04,ROM_Z
               BNE     >1
               MOVE.B   #$FC,PRAM_Z
               JMP     >3
^1
               CMP.B   #$08,ROM_Z
               BNE     >1
               MOVE.B   #$F8,PRAM_Z
               JMP     >3
^1
               JMP     MENU
              
^3
               MOVE.B   RBK_H,D0            ;
               MOVE.W   D0,GBAC_HIO         ; SET GBA CARD ROM BANK
              
               MOVE.B   RBK_L,D0            ;
               MOVE.W   D0,GBAC_LIO         ; SET GBA CARD ROM BANK
              
               MOVE.B   PRAM_Z,D0           ; SET PSRAMM SIZE
               MOVE.W   D0,GBAC_ZIO         ;

               JSR      SET_SRAM            ;
               CMP.B    #$01,MK3
               BNE      >0
                
               AND.B   #11111110B,RUN       ; OFF FM
^0
               MOVE.B   RUN,D0              ; SET OPTION
               MOVE.W   D0,OPTION_IO
               MOVE.W   #$00FF,D0           ; SET RUN
               MOVE.W   D0,RST_IO           ;
               MOVE.W   D0,RUN_IO           ;
              
               MOVEA.L  $0000,A7
               MOVEA.L  $0004,A3
               JMP      (A3)
MD5:

               MOVE.W   #$0007,D0           ; SET MODE7  COPY MODE
               MOVE.W   D0,OPTION_IO        ;
                
               MOVE.B   RBK_H,D0            ; SET BANK A25~A24
               MOVE.W   D0,GBAC_HIO         ;

               MOVE.B   RBK_L,D0            ; SET BANK A23~A16
               MOVE.W   D0,GBAC_LIO         ;

               MOVE.W   #$00F8,D0           ; SET GBA CARD ROM SIZE
               MOVE.W   D0,GBAC_ZIO         ;

               MOVE.W   #$0000,D0           ; SET PSRAM  BANK
               MOVE.W   D0,PRAM_BIO         ;

               MOVE.W   #$0038,D0           ; SET PSRAMM SIZE
               MOVE.W   D0,PRAM_ZIO         ;

               MOVE.W   #$0002,D0           ; SET PSWE ON
               MOVE.W   D0,WE_IO            ;
;;==============================================================================
               MOVE.B   #$00,MOVP_Z         ; SET PSRAM BANK 0
              
                CMP.B   #$01,ROM_Z
                BEQ     MOVE_1M
               
                CMP.B   #$02,ROM_Z
                BEQ     MOVE_2M
               
                CMP.B   #$04,ROM_Z
                BEQ     MOVE_4M
               
                CMP.B   #$05,ROM_Z
                BEQ     MOVE_5M
               
                CMP.B   #$06,ROM_Z
                BEQ     MOVE_6M
               
                CMP.B   #$08,ROM_Z
                BEQ     MOVE_8M
               
                CMP.B   #$09,ROM_Z
                BEQ     MOVE_16M
               
                CMP.B   #$0A,ROM_Z
                BEQ     MOVE_24M
               
                CMP.B   #$0B,ROM_Z
                BEQ     MOVE_32M
               
                CMP.B   #$0C,ROM_Z
                BEQ     MOVE_40M
               
                JMP     MENU
;===============================================================================
MOVE_1M:
               MOVE.B   #$FF,PRAM_Z
               MOVE.W   #$00FF,D0
               MOVE.W   D0,GBAC_ZIO
               MOVE.L   #$020000,D1         ; SIZE 1M
               JSR      NEO_B0              ; MOVE BAN0 8M
               JMP      RUN_MYTH
MOVE_2M:
               MOVE.B   #$FE,PRAM_Z
               MOVE.W   #$00FE,D0
               MOVE.W   D0,GBAC_ZIO
              
               MOVE.L   #$040000,D1         ; SIZE 2M
               JSR      NEO_B0              ; MOVE BAN0 8M
               JMP      RUN_MYTH
MOVE_4M:
               MOVE.B   #$FC,PRAM_Z
               MOVE.W   #$00FC,D0
               MOVE.W   D0,GBAC_ZIO
               MOVE.L   #$080000,D1         ; SIZE 4M
               JSR      NEO_B0              ; MOVE BAN0 8M
               JMP      RUN_MYTH
MOVE_5M:
               MOVE.B   #$F8,PRAM_Z
               MOVE.W   #$00F8,D0
               MOVE.W   D0,GBAC_ZIO
               MOVE.L   #$0C0000,D1         ; SIZE 5M
               JSR      NEO_B0              ; MOVE BAN0 8M
               JMP      RUN_MYTH
MOVE_6M:
               MOVE.B   #$F8,PRAM_Z
               MOVE.W   #$00F8,D0
               MOVE.W   D0,GBAC_ZIO
               MOVE.L   #$0E0000,D1         ; SIZE 6M
               JSR      NEO_B0              ; MOVE BAN0 8M
               JMP      RUN_MYTH
                 
MOVE_8M:
               MOVE.B   #$F8,PRAM_Z
               MOVE.W   #$00F8,D0
               MOVE.W   D0,GBAC_ZIO
               MOVE.B   #$01,MOVE_Z         ; MOVE 8M
               JMP      MOVE_MX
              
MOVE_16M:
               MOVE.B   #$F0,PRAM_Z         ; SET 16M ROM SPACE
               MOVE.B   #$02,MOVE_Z         ; MOVE 16M
               JMP      MOVE_MX
              
MOVE_24M:
               MOVE.B   #$E0,PRAM_Z         ; SET 24M ROM SPACE
               MOVE.B   #$03,MOVE_Z         ; MOVE 24M
               JMP      MOVE_MX
              
MOVE_32M:
               MOVE.B   #$E0,PRAM_Z         ; SET  32M ROM SPACE
               MOVE.B   #$04,MOVE_Z         ; MOVE 24M
               JMP      MOVE_MX
              
MOVE_40M:
               MOVE.B   #$00,PRAM_Z         ; SET  32M ROM SPACE
               MOVE.B   #$05,MOVE_Z         ; MOVE 40M
               JMP      MOVE_MX
              
MOVE_MX:
^0
               JMP      PCONT
^9
               MOVE.L   #$100000,D1         ; MOVE 8M0
               MOVE.B   MOVP_Z,D0           ; SET PSRAM  BANK
               MOVE.W   D0,PRAM_BIO         ;
               MOVE.W   D0,$A13016          ; LED
              
               MOVE.B   RBK_L,D0            ;
               MOVE.W   D0,GBAC_LIO         ; SET GBA CARD ROM BANK
               JSR      NEO_B0              ; MOVE BAN0 8M
               ADD.B    #$08,RBK_L          ;
               ADD.B    #$01,MOVP_Z         ; SET PSRAM BANK
              
               SUB.B    #$01,MOVE_Z
               CMP.B    #$00,MOVE_Z
               BNE      <0
               JMP      RUN_MYTH
;——————————————————————————-
PCONT:
               CMP.B    #$00,MOVP_Z
               BNE      >1
               lea      MAKE21(PC),a0  ;AAAA
               JSR      PRINTA
               JMP      <9
^1
               CMP.B    #$01,MOVP_Z
               BNE      >1
               lea      MAKE22(PC),a0  ;AAAA
               JSR      PRINTA
               JMP      <9

^1
               CMP.B    #$02,MOVP_Z
               BNE      >1
               lea      MAKE23(PC),a0  ;AAAA
               JSR      PRINTA
               JMP      <9

^1
               CMP.B    #$03,MOVP_Z
               BNE      >1
               lea      MAKE24(PC),a0  ;AAAA
               JSR      PRINTA
               JMP      <9

^1
               CMP.B    #$04,MOVP_Z
               BNE      >1
               lea      MAKE25(PC),a0  ;AAAA
               JSR      PRINTA
^1
               JMP      <9
;===============================================================================
NEO_B0:
           ;   LEA      $100000,A0
               LEA      $000000,A0
               LEA      $200000,A1
^0
               MOVE.W   (A0)+,(A1)+

               CMP.L   A0,D1
               BNE     <0
               RTS
;;==============================================================================
RUN_MYTH:
               MOVE.W   #$0000,D0           ; SET PSWE OFF
               MOVE.W   D0,WE_IO            ;

               MOVE.W   #$0000,D0           ; SET PSRAM  BANK
               MOVE.W   D0,PRAM_BIO         ;

               MOVE.B   PRAM_Z,D0           ; SET PSRAMM SIZE
               MOVE.W   D0,PRAM_ZIO         ;

               MOVE.W   #$0000,OPTION_IO    ; SET MODE 0
               MOVE.W   #$0000,GBAC_ZIO     ; SET GBA ROM ZIO
              
               MOVE.L   #$00370003,NEO2_C   ; SET MENU ROM
               JSR      NEO_CMD
               MOVE.L   #$00DA0044,NEO2_C   ; SET MENU ROM
               JSR      NEO_CMD
               MOVE.W   #$0000,GBAC_LIO
               MOVE.W   #$0000,GBAC_HIO

               JSR      SET_SRAM            ; SET SRAM SIZE & BANK
                 
               MOVE.B   RUN,D0              ; SET OPTION
               MOVE.W   D0,OPTION_IO

               MOVE.W   #$00FF,D0           ; SET RUN
               MOVE.W   D0,RST_IO           ;
               MOVE.W   D0,RUN_IO           ;
              
               MOVEA.L  $0000,A7
               MOVEA.L  $0004,A3
               JMP      (A3)
;===============================================================================
NEO_A0:
               MOVE.B   NEO2+1,D0
               AND.L    #$000000F0,D0      ;
               MOVE.W   D0,GBAC_LIO        ;SET BANK
               MOVE.B   NEO2+1,D0
               AND.L    #$0000000F,D0      ;
               MOVE.B   D0,NEO2+1
               MOVE.L   NEO2,D0
               ASL.L    #$01,D0
               MOVE.L     D0,A0
               MOVE.W   (A0),D0
               RTS
;===============================================================================
NEO_CMD:
               MOVE.L   #$00FFD200,NEO2     ;
               JSR      NEO_A0
               MOVE.L   #$00001500,NEO2     ;
               JSR      NEO_A0
               MOVE.L   #$0001D200,NEO2     ;
               JSR      NEO_A0
               MOVE.L   #$00021500,NEO2     ;
               JSR      NEO_A0
               MOVE.L   #$00FE1500,NEO2     ;
               JSR      NEO_A0
               MOVE.L   NEO2_C,NEO2         ;
               JSR      NEO_A0
               RTS
;===============================================================================
SET_SRAM:
               CMP.B    #$00,SR_Z
               BEQ      >9
^0
               CMP.B    #$01,SR_Z       ;   8K
               BNE      >1
               MOVE.W   #$001F,D0
               MOVE.W   D0,GBAS_ZIO
              
               MOVE.B   SR_B,D0
               MOVE.W   D0,GBAS_BIO     ;  8K BANK0
               JMP      >9
;——————————————————————————-
^1
               CMP.B    #$03,SR_Z       ;  32K
               BNE      >1
               MOVE.W   #$001C,D0
               MOVE.W   D0,GBAS_ZIO
               CMP.B    #$00,SR_B
               BNE      >0
               MOVE.W   #$0000,GBAS_BIO ;  32K  BANK0
               JMP      >9
^0
               CMP.B    #$01,SR_B
               BNE      >0
               MOVE.W   #$0004,D0
               MOVE.W   D0,GBAS_BIO     ;  32K  BANK1
               JMP      >9
^0
               CMP.B    #$02,SR_B
               BNE      >0
               MOVE.W   #$0008,D0
               MOVE.W   D0,GBAS_BIO     ;  32K  BANK2
               JMP      >9
^0
               CMP.B    #$03,SR_B
               BNE      >0
               MOVE.W   #$000C,D0
               MOVE.W   D0,GBAS_BIO     ;  32K  BANK3
               JMP      >9
;——————————————————————————-
               CMP.B    #$04,SR_Z       ;  64K
               BNE      >1
               MOVE.W   #$0018,D0
               MOVE.W   D0,GBAS_ZIO ;
               CMP.B    #$00,SR_B
               BNE      >0
               MOVE.W   #$0000,GBAS_BIO ;  64K BANK0
               JMP      >9
^0
               BNE      >0
               CMP.B    #$01,SR_B
               MOVE.W   #$0008,D0
               MOVE.W   D0,GBAS_BIO     ;  64K BANK1
               JMP      >9
;——————————————————————————-
               CMP.B    #$05,SR_Z       ;  128K
               BNE      >9
               MOVE.W   #$0010,D0
               MOVE.W   D0,GBAS_ZIO ;
               MOVE.W   #$0000,GBAS_BIO ;  128  BANK0
               JMP      >9
^9
               RTS

              
;===============================================================================
TEST_NEO_CARD:

                MOVE.B   #$00,ERR
               
                MOVE.W   #$FFFF,$0A1301A   
                MOVE.W   #$0000,OPTION_IO  
                MOVE.L   #$00903500,NEO2_C 
                JSR      NEO_CMD
                MOVE.W   #$0001,OPTION_IO  
               
                CMP.B    #$34,$200001
                BNE      >2
                CMP.B    #$16,$200003
                BNE      >2
                CMP.B    #$96,$200005
                BNE      >2
                CMP.B    #$24,$200007
                BNE      >2
;——————————————————————————-
                MOVE.B   #$00,ERR
                JMP      >0
^2
                MOVE.B   #$80,ERR
                lea      MAKE17(PC),a0  ;AAAA
                JSR      PRINTA

^0
                MOVE.W   #$0000,OPTION_IO    ; SET MODE0
                MOVE.L   #$00904900,NEO2_C   ; OFF NEO ID
                JSR      NEO_CMD
                MOVE.W   #$0000,$0A1301A     ; SET GBA CARD ID OFF
                RTS
               
TEST_A245:
                RTS
;===============================================================================
TEST_A25:
                JSR      TEST_A245
                JMP      MENU
;===============================================================================
PPU:
                jsr     wjoy
                MOVE.W  CONT,D0
                CMP.W   #$00,D0
                BEQ     >0
                SUB     #$01,D0
                MOVE.W  D0,CONT

                MOVE.W  CONT2,D0        ; DBC SUB
                MOVE    #$01,D1         ;
                SBCD    D1,D0           ;
                MOVE.W  D0,CONT2        ;

                MOVE.W  INA,D0
                SUB     #$20,D0
                MOVE.W  D0,INA
                JMP     PRINTX
^0
                JMP     MENU
;===============================================================================
PPD:
                jsr     wjoy
                MOVE.W  CONT,D0
                MOVE.W  CARD,D1
                CMP.W   D0,D1
                BEQ     >0

                ADD     #$01,D0
                MOVE.W  D0,CONT

                MOVE.W  CONT2,D0        ; BCD ADD
                MOVE    #$01,D1         ;
                ABCD    D1,D0           ;
                MOVE.W  D0,CONT2        ;

                MOVE.W  INA,D0
                ADD     #$20,D0
                MOVE.W  D0,INA
                JMP     PRINTX
^0
                JMP     MENU
                MOVE.W  #$00,CONT
                MOVE.W  #$00,INA
                JMP     PRINTX
;===============================================================================
PRINTX:
                LEA     ms0,A0
                MOVE.W  INA,D0
                ADD     D0,A0             ; 0
               
                ADD     #$01,A0           ; 1 BYTE 1
                MOVE.B  (A0),MODE
;*******************************************************************************
                ADD     #$01,A0           ; 2 BYTE 1
                MOVE.B  (A0),RBK_H        ; A24~A25
                AND.B   #00001111B,RBK_H  ; 0000XXXX
               
                MOVE.B  (A0),D4           ; ROM SIZE
                ASR     #$04,D4           ; –> move right
                AND.B   #00001111B,D4     ; 0000XXXX
                MOVE.B  D4,ROM_Z          ;

;*******************************************************************************
                ADD     #$01,A0           ; 3 BYTE 1
                MOVE.B  (A0),RBK_L
;*******************************************************************************
                ADD     #$01,A0           ; 4 BYTE 1
                MOVE.B  (A0),SR_Z;        ; GBA SRAM SIZE
                AND.B   #00001111B,SR_Z   ; 0000XXXX
               
                MOVE.B  (A0),D4           ;
                ASR.B   #$04,D4           ; –> move right
                AND.B   #00001111B,D4     ; 0000XXXX
                MOVE.B  D4,SR_B           ; GBA SRAM BANK
;*******************************************************************************
                ADD     #$01,A0           ; 5 BYTE 1
                MOVE.B  (A0),MODEA
;*******************************************************************************
                ADD     #$01,A0           ; 6 BYTE 1
                MOVE.B  (A0),RUN
;*******************************************************************************
                ADD     #$01,A0           ; 7 BYTE 1
;               MOVE.B  (A0),SPED

                ADD     #$01,A0           ; 8
                JMP     PRINTY
;===============================================================================
PRINTY:
                clr.l   d1
                clr.l   d2
                move.b  #14,d1
                bsr     printz

                CMP.B   #$00,MODE
                BEQ     >0
                CMP.B   #$01,MODE
                BEQ     >1
                CMP.B   #$02,MODE
                BEQ     >2
                JMP     MENU

^0
                move.b  #20,d1
                lea     MAKE4(PC),a0
                bsr     printz
                move.b  #22,d1
                lea     MAKE5(PC),a0
                bsr     printz
                lea     MAKE8(PC),a0
                JMP     >3
^1
                move.b  #20,d1
                lea     MAKE4(PC),a0
                bsr     printz
                move.b  #22,d1
                lea     MAKE5(PC),a0
                bsr     printz
                lea     MAKE9(PC),a0
                JMP     >3

^2
                move.b  #20,d1
                lea     MAKE6(PC),a0
                bsr     printz
                move.b  #22,d1
                lea     MAKE7(PC),a0
                bsr     printz
                lea     MAKE10(PC),a0
                JMP     >3
^3
                BSR     PRINTA
                BSR     PASC
                JMP     MENU
PRINTA:
                clr.l   d2
                move.b  #10,d1
                bsr     printz
                RTS
********************************************************************************
printz:
                clr.l   d0
                move.b  d1,d0
                add.l   #1,d0
                lsl.w   #6,d0
                add.b   d2,d0
                add.l   #1,d0
                lsl.l   #3,d0
                lsr.w   #2,d0
                swap    d0
                add.l   #$60000003,d0
                move.w  #$8F02,($C00004)
                move.l  d0,($C00004)
                clr.w   d0
printzloop:
                move.b  (a0)+,d0
                sub.b   #32,d0
                move.w  d0,($C00000)
                tst.b   (a0)
                bne     printzloop
                rts
********************************************************************************
wjoy:
                jsr      rjoy
                CMP.W    #$0000,D0
                BNE      wjoy
                rts
********************************************************************************
rjoy:

                MOVE.B  $A10001,D4

                LEA      $A10003,A6
                LEA      CPJOY,A5
               
                MOVE.W   #$0100,$A11100
                MOVE.W   #$0040,$A10008
                NOP
                NOP
                MOVE.B   #$40,(A6) ; READ X.X.S.A.R.L.D.U
                NOP
                NOP
                NOP
                MOVE.B   (A6),D1
                MOVE.B   #$00,(A6)
                NOP
                NOP
                NOP
                MOVE.B   (A6),D0   ; READ X.X.C.B.R.L.D.U
                LSL.B    #2,D0
                ANDI.B   #11000000B,D0
                ANDI.B   #00111111B,D1
                OR.B     D1,D0
                NOT.B    D0
                MOVE.W   D0,CPJOY
               
                MOVE.W   #$0000,$A11100

                MOVE.W   #$0000,D1
^0
                ADD      #$01,D1
                CMP.W    #$1000,D1
                BNE      <0

                RTS

********************************************************************************
PASC:
                MOVE.W     CONT2,D0        ; BCD ADD
                MOVE.W     #$01,D1         ;
                LSR        #$08,D0
                AND        #$0F,D0
                LEA        ASCII,A0
                LEA        DASC,A1
                MOVE.B     #$47,(A1)+
                MOVE.B     #$41,(A1)+
                MOVE.B     #$4D,(A1)+
                MOVE.B     #$45,(A1)+
                MOVE.B     #$3A,(A1)+
                ADD        D0,A0
                MOVE.B     (A0),(A1)+

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                MOVE.W     CONT2,D0        ; BCD ADD
                MOVE.W     #$01,D1         ;
                LSR        #$04,D0
                AND        #$0F,D0
                LEA        ASCII,A0
                ADD        D0,A0
                MOVE.B     (A0),(A1)+

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                MOVE.W     CONT2,D0        ; BCD ADD
                MOVE       #$0001,D1         ;
                AND        #$0F,D0         ;

                LEA        ASCII,A0
                ADD        D0,A0
                MOVE.B     (A0),(A1)+
                MOVE.B     #$00,(A1)
                move       #12,d1
                lea        DASC,a0
                bsr        printz
                RTS

ASCII:  dc.b   '0123456789ABCDEF',0
********************************************************************************
MAKE0:  dc.b   '(C)2009 NEO MD MYTH SYSTEM       ',0
;MAKE1:  dc.b   '          MENU  V 1.0B           ',0
MAKE1:  dc.b   '          MENU  V 2.01           ',0
MAKE2:  dc.b   '   SUPER 32X,MD,SMS MYTH CARD    ',0
MAKE3:  dc.b   '   SELECT GAME  UP,DOWN          ',0
MAKE4:  dc.b   '    PLAY  GAME  B,C              ',0
MAKE5:  dc.b   '                                 ',0
MAKE6:  dc.b   '    PLAY  GAME  B,FM OFF         ',0
MAKE7:  dc.b   '    PLAY  GAME  C,FM ON          ',0

MAKE8:  dc.b   'MODE:SEGA MEGA DRIVE & GENSIS    ',0
MAKE9:  dc.b   'MODE:SEGA 32X                    ',0
MAKE10: dc.b   'MODE:SEGA MASTER                 ',0
MAKE11: dc.b   'LOADING……………..         ',0
MAKE12: dc.b   'BBBBBBBBBBBBBBBB                 ',0
MAKE13: dc.b   'LOADING ………………….   ',0
MAKE14: dc.b   'TEST GBA CARD (C) ERROR !        ',0
MAKE15: dc.b   'TEST GBA CARD OK                 ',0
MAKE16: dc.b   'TEST GBA CARD (S) ERROR !        ',0
MAKE17: dc.b   'NOT NEO CARD                     ',0
MAKE18: dc.b   'TEST GBA CARD (S) ERROR !        ',0
MAKE19: dc.b   'TEST GBA CARD (S) ERROR !        ',0
MAKE20: dc.b   'TEST GBA CARD (S) ERROR !        ',0
MAKE30: dc.b   'WAIT PRAM DOWNLOAD …………. ',0

MAKE21: dc.b   'LOADING … 8M                   ',0
MAKE22: dc.b   'LOADING …16M                   ',0
MAKE23: dc.b   'LOADING …24M                   ',0
MAKE24: dc.b   'LOADING …32M                   ',0
MAKE25: dc.b   'LOADING …40M                   ',0

 

;             include MENU-B.DAT
;             include MENU-C.DAT

              ORG         $FF3000
;             Include MENU-F2.DAT
;             $00 = 00 HAVE GAME
;             $01 = 00 SEGA5
;                   01 32X
;                   02 SEGA4
;             $02 = YX Y > ROM SIZE
;                      X > BIT 1,0 = A25 & A24
;             $03 = 00  >A23~A16
;             $04 = YX Y >SRAM BANK
;                      X >SRAM SIZE
;             $05 =
;             $06 = RUN MODE

MENU_X:
;ms0:  DC.B    $00,$02,$40,$00,$01,$00,$13,$00
;      DC.B    'SMS 00                ',0

;ms0: DC.B    $00,$00,$C0,$00,$00,$00,$04,$00
;     DC.B    'JAPAN 40M             ',0

ms0:  DC.B    $00,$00,$41,$80,$01,$00,$02,$00
      DC.B    '32M 180 32M+SAVE      ',0

                 ORG  MENU_X+$20
ms1:  DC.B    $00,$00,$40,$00,$11,$00,$06,$00
      DC.B    '32M 00                ',0

                 ORG  MENU_X+$40
ms2:  DC.B    $00,$00,$B0,$40,$00,$00,$06,$12
      DC.B    '32M 40                ',0

                 ORG  MENU_X+$60
ms3:  DC.B    $00,$00,$B0,$60,$00,$00,$06,$22
      DC.B    '32M 60                ',0

                 ORG  MENU_X+$80
ms4:  DC.B    $00,$00,$B0,$80,$00,$00,$06,$34
      DC.B    '32M 80                ',0

                 ORG  MENU_X+$A0
ms5:  DC.B    $00,$00,$B0,$A0,$00,$00,$06,$35
      DC.B    '32M A0                ',0

                 ORG  MENU_X+$C0
ms6:  DC.B    $00,$00,$B0,$C0,$00,$00,$06,$36
      DC.B    '32M C0                ',0

                 ORG  MENU_X+$E0
ms7:  DC.B    $00,$00,$B0,$E0,$00,$00,$06,$37
      DC.B    '32M E0                ',0

                 ORG  MENU_X+$100
ms8:  DC.B    $00,$00,$B1,$00,$00,$00,$06,$00
      DC.B    '32M 100               ',0

                 ORG  MENU_X+$120
ms9:  DC.B    $00,$00,$B1,$20,$00,$00,$06,$00
      DC.B    '32M 120               ',0

                 ORG  MENU_X+$140
ms10: DC.B    $00,$00,$B1,$40,$00,$00,$06,$00
      DC.B    '32M 140               ',0

                 ORG  MENU_X+$160
ms12: DC.B    $00,$00,$B1,$60,$00,$00,$06,$00
      DC.B    '32M 160               ',0

                 ORG  MENU_X+$180
ms14: DC.B    $00,$00,$B1,$80,$01,$00,$02,$00
      DC.B    'MD 180 SAVE           ',0

                 ORG  MENU_X+$1A0
ms16: DC.B    $00,$00,$B1,$A0,$00,$00,$06,$00
      DC.B    'MD 1A0                ',0

                 ORG  MENU_X+$1C0
ms18: DC.B    $00,$00,$B1,$C0,$00,$00,$06,$00
      DC.B    'MD 1C0                ',0

                 ORG  MENU_X+$1E0
ms20: DC.B    $00,$00,$B1,$E0,$00,$00,$06,$00
      DC.B    'MD 1E0                ',0

                 ORG  ms20+$20
ms22: DC.B    $00,$00,$B2,$00,$00,$00,$06,$00
      DC.B    'MD 200                ',0

                 ORG  ms22+$20
ms24: DC.B    $00,$00,$B2,$20,$00,$00,$06,$00
      DC.B    'MD 220                ',0

                 ORG  ms24+$20
ms26: DC.B    $FF,$00,$40,$9C,$00,$00,$01,$00
      DC.B    'MD 9C                 ',0

                 ORG  ms26+$20
ms28: DC.B    $00,$00,$B0,$A0,$00,$00,$06,$00
      DC.B    'MD A0                 ',0

                 ORG  ms28+$20
ms30: DC.B    $00,$00,$B0,$C0,$00,$00,$06,$00
      DC.B    'MD C0                 ',0

                 ORG  ms30+$20
ms32: DC.B    $00,$00,$A0,$E0,$00,$00,$06,$00
      DC.B    'MD E0                 ',0

                 ORG  ms32+$20
ms34: DC.B    $00,$00,$80,$F8,$00,$00,$01,$00
      DC.B    'MD F8 CASTLE          ',0

                 ORG  ms34+$20
ms36: DC.B    $00,$00,$90,$70,$00,$00,$01,$00
      DC.B    'MD 70                 ',0

                 ORG  ms36+$20
ms38: DC.B    $00,$00,$90,$70,$00,$00,$01,$00
      DC.B    'MD 70                 ',0

                 ORG  ms38+$20
ms40  DC.B    $00,$00,$B1,$00,$00,$00,$06,$00
      DC.B    'MD 100 (256M BANK2)   ',0

                 ORG  ms40+$20
ms42  DC.B    $00,$00,$B1,$20,$00,$00,$06,$00
      DC.B    'MD 120 (256M BANK2)   ',0

                 ORG  ms42+$20
ms44  DC.B    $00,$00,$B1,$40,$00,$00,$06,$00
      DC.B    'MD 140 (256M BANK2)   ',0

                 ORG  ms44+$20
ms46  DC.B    $00,$00,$B1,$60,$00,$00,$06,$00
      DC.B    'MD 160 (256M BANK2)   ',0

                 ORG  ms46+$20
ms48  DC.B    $00,$00,$B1,$80,$00,$00,$06,$00
      DC.B    'MD 180 (256M BANK2)   ',0

                 ORG  ms48+$20
ms50  DC.B    $00,$00,$B1,$A0,$00,$00,$06,$00
      DC.B    'MD 1A0 (256M BANK2)   ',0

                 ORG  ms50+$20
ms52  DC.B    $00,$00,$B1,$E0,$00,$00,$02,$00
      DC.B    'MD 1E0 (256M BANK2)   ',0

                 ORG  ms52+$20
ms54  DC.B    $00,$00,$B1,$E0,$00,$00,$02,$00
      DC.B    'MD 1E0 (256M BANK2)   ',0

                 ORG  ms54+$20
ms56  DC.B    $00,$00,$A0,$00,$00,$00,$03,$00
      DC.B    'MD 32X                ',0

      DC.B    $FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF,$FF
              END

Leave a Reply