[FC][FC CAPCOM MUSIC 30 IN 1]

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
FlameCyclone
Posts: 13
Joined: Fri Jun 02, 2017 2:45 am

[FC][FC CAPCOM MUSIC 30 IN 1]

Post by FlameCyclone » Fri May 17, 2019 9:26 pm

[FC][FC CAPCOM MUSIC 30 IN 1][20190518]
[FC][卡普空音乐30合1][20190518]-0.png
[FC][卡普空音乐30合1][20190518]-0.png (2 KiB) Viewed 6805 times
[FC][卡普空音乐30合1][20190518]-1.png
[FC][卡普空音乐30合1][20190518]-1.png (2.52 KiB) Viewed 6805 times
[FC][卡普空音乐30合1][20190518]-2.png
[FC][卡普空音乐30合1][20190518]-2.png (2.3 KiB) Viewed 6805 times
[FC][卡普空音乐30合1][20190518]-3.png
[FC][卡普空音乐30合1][20190518]-3.png (2.51 KiB) Viewed 6805 times

Code: Select all

;[FC][卡普空音乐30合1][20190518]
;FlameCyclone
;============================================================
RESET_ADDR = $8000                              ;重置中断指针
;============================================================
ITEM_MAX_COUNT   = 030                              ;最大项数
ITEM_PAGE_SIZE   = 06                               ;每页项数
ITEM_BUFFER_SIZE = 01                         ;单次写入缓冲数
;------------------------------------------------------------
ITEM_MAX  = ITEM_MAX_COUNT - 001                    ;最大项数
;------------------------------------------------------------
 .IF ITEM_MAX < ITEM_PAGE_SIZE
ITEM_PAGE = ITEM_MAX_COUNT                          ;每页项数
ITEM_PAGE_MAX  = 0                                    ;最大页
 .ELSE
ITEM_PAGE = ITEM_PAGE_SIZE                          ;每页项数
ITEM_PAGE_MAX  = ITEM_MAX / ITEM_PAGE * ITEM_PAGE     ;最大页
 .ENDIF
 .IF ITEM_MAX_COUNT % ITEM_PAGE
ITEM_PAGE_SUM  = ITEM_MAX_COUNT / ITEM_PAGE + 1       ;总页数
 .ELSE
ITEM_PAGE_SUM  = ITEM_MAX_COUNT / ITEM_PAGE           ;总页数
 .ENDIF
;============================================================
CHAR_NULL  = $00                                  ;空字符索引
CHAR_SPACE = ' '                                ;空格字符索引
CHAR_POINT = '.'                                ;空格句号索引
CHAR_PER   = '/'                                ;斜杠符号索引
CHAR_DIGIT = '0'                                ;数字字符起始
CHAR_ARROW = $1F                            ;光标箭头图形索引
;============================================================
ORDER_INDEX_LENGTH = $02                        ;序号数字长度
PAGE_INDEX_LENGTH  = $02                        ;页号数字长度
SOUND_INDEX_LENGTH = $03                        ;曲号数字长度
;------------------------------------------------------------
NMUBER_LENGTH_MAX  = $03                        ;最大数字长度
;============================================================
FC_Data_L   = $80                               ;数据地址低位
FC_Data_H   = FC_Data_L+$01                     ;数据地址高位
;===========================================================
FC_PPU_Buffer = $0200                            ;PPU缓冲地址
FC_PPU_Status = FC_PPU_Buffer+$80                ;PPU显示状态
FC_PPU_Cursor = FC_PPU_Status + $01          ;当前PPU缓冲位置
FC_PPU_Addr_L = FC_PPU_Cursor + $01              ;PPU地址低位
FC_PPU_Addr_H = FC_PPU_Addr_L + $01              ;PPU地址高位
;============================================================
FC_Data_Cnt     = FC_PPU_Addr_H+$01                 ;数据计数
Item_Index_Cur  = FC_Data_Cnt + $01                 ;当前索引
Item_Index_Old  = Item_Index_Cur + $01              ;历史索引
Item_Page_Cur   = Item_Index_Old + $01                ;当前页
Item_Page_Old   = Item_Page_Cur + $01                 ;历史页
Item_Index_Cnt  = Item_Page_Old + $01               ;索引计数
Item_Write_Buf  = Item_Index_Cnt + $01          ;项缓冲最大数
;============================================================
BTN_DELAY_TIME  = $18                           ;按键延时启动
BTN_DELAY_SPEED = $08                           ;按键延时速度
;------------------------------------------------------------
Btn_Once        = Item_Write_Buf + $01              ;单次按键
Btn_Keep        = Btn_Once + $01                    ;长按按键
Btn_Delay       = Btn_Keep + $01                    ;长按延时
;------------------------------------------------------------
BTN_UP     = $08                                        ;上键
BTN_DOWN   = $04                                        ;下键
BTN_LEFT   = $02                                        ;左键
BTN_RIGHT  = $01                                        ;右键
BTN_B      = $40                                         ;B键
BTN_A      = $80                                         ;A键
BTN_SELECT = $20                                      ;选择键
BTN_START  = $10                                      ;开始键
;============================================================
SCROLL_H_VALUE = $08                                ;水平滚动
SCROLL_V_VALUE = $EC                                ;垂直滚动
;------------------------------------------------------------
Scroll_H = Btn_Delay + $01                          ;水平滚动
Scroll_V = Scroll_H + $01                           ;垂直滚动
;============================================================
DEC_100 = Scroll_V + $01                          ;十进制百位
DEC_010 = DEC_100 + $01                           ;十进制十位
DEC_001 = DEC_010 + $01                           ;十进制个位
;============================================================
Sound_8000_Addr = DEC_001 + $01            ;音乐$8000页Bank号
Sound_A000_Addr = Sound_8000_Addr + $01    ;音乐$8000页Bank号
Sound_Port      = Sound_A000_Addr + $01     ;音乐端口指令地址
Sound_Port_L    = Sound_Port + $01          ;音乐端口地址低位
Sound_Port_H    = Sound_Port_L + $01        ;音乐端口地址高位
;================================================================================
MENU_BANK = $00                                                ;菜单$8000页Bank号
SOUND_PROGRAM_SIZE = MenuBankProgram - SoundBankProgram         ;音乐切页程序大小
MENU_PROGRAM_SIZE  = SoundPlayProgram - MenuBankProgram         ;菜单切页程序大小
SOUND_PLAY_SIZE    = SoundProgramEnd - SoundPlayProgram         ;音乐播放程序大小
SOUND_PROCESS_SIZE = SoundProgramEnd - SoundProgram                 ;音乐程序大小
;--------------------------------------------------------------------------------
Sound_Bank_Process = Sound_Port_H + $01                         ;音乐切页程序地址
Menu_Bank_Process  = Sound_Bank_Process + SOUND_PROGRAM_SIZE    ;菜单切页程序地址
Sound_Play_Addr    = Menu_Bank_Process + MENU_PROGRAM_SIZE      ;音乐播放程序地址
;--------------------------------------------------------------------------------
Sound_Index = Sound_Bank_Process + SOUND_PROCESS_SIZE               ;音乐曲目索引
;================================================================================

 .ORG RESET_ADDR
;========================================
ProgramBegin:                   ;程序开始
 SEI
 CLD
 LDX #$FF
 TXS
 LDA #$00
 STA $2000
 STA $2001

;========================================
TimeDelay:                      ;延时等待
 LDX #$02
TimeDelayA:
 BIT $2002
 BPL TimeDelayA
TimeDelayB:
 BIT $2002
 BMI TimeDelayB
 DEX
 BNE TimeDelayA

;========================================
ClearScreen:                    ;清空屏幕
 JSR PaletteClear
 JSR NameTableClear

;========================================
PortInit:                     ;端口初始化
 LDA #$0F
 STA $4015
 LDA #$C0
 STA $4017
 LDA #$00
 STA $A000

;========================================
RamInit:                      ;内存初始化
 LDX #$00
 TXA
 STA $00
 STA $01
 LDY #$00
RamInitSet:
 STA ($00),Y
 INY
 BNE RamInitSet
 INC $01
 INX
 CPX #$08
 BCC RamInitSet

 JSR InitSoundProcess
 LDA #$4C
 STA Sound_Port
;========================================
ScreenInit:                   ;屏幕初始化
 JSR ChrSteup
 JSR PaletteSteup
 JSR PpuLayoutSteup
 LDA #SCROLL_H_VALUE
 STA Scroll_H
 LDA #SCROLL_V_VALUE
 STA Scroll_V
 JSR SoundInitIndex
 JSR ShowTitle
 JSR ShowPageItems
 JSR ShowPageIndex
 JSR ShowArrow
 LDA #$0E
 STA FC_PPU_Status
 
 JSR SoundSelect
;========================================
Circle:                             ;循环
 JSR NmiDelay
 JSR ButtonProcess
 JSR ChangeItemIndex
 JMP Circle

;========================================
NmiDelay:                        ;NMI延时
 LDA $2002
 BPL NmiDelay
 JSR FC_PPU_Process
 LDA Scroll_H
 STA $2005
 LDA Scroll_V
 STA $2005
 JSR SoundPlay
 RTS
 
;========================================
MODE_CNTL = $FB               ;行写入模式
MODE_CNTC = $FC               ;行清除模式
MODE_CNTN = $FD               ;行转行模式
MODE_CNTS = $FE         ;转行空格写入模式
;----------------------------------------
FC_PPU_Process:                  ;PPU处理
 LDA FC_PPU_Buffer
 BEQ FC_PPU_Process_End
 JSR FC_PPU_Process_Beg
FC_PPU_Process_End:
 LDA #$00
 STA FC_PPU_Buffer
 STA $2006
 STA $2006
 STA $2005
 STA $2005
 LDA FC_PPU_Status
 STA $2001
 RTS

;----------------------------------------
FC_PPU_Process_Beg:             ;处理开始
 LDX FC_PPU_Cursor
 LDA #$00
 STA $2001
 STA FC_PPU_Buffer,X
 STA FC_PPU_Cursor
 LDX #$FF
;----------------------------------------
FC_PPU_Mode_Select:             ;模式选择
 INX
 LDA FC_PPU_Buffer,X
 CMP #MODE_CNTL
 BEQ FC_PPU_Mode_CountLine
 CMP #MODE_CNTC
 BEQ FC_PPU_Mode_CountClear
 CMP #MODE_CNTN
 BEQ FC_PPU_Mode_CountNext
 CMP #MODE_CNTS
 BEQ FC_PPU_Mode_CountSpace
 RTS

;----------------------------------------
FC_PPU_Mode_CountLine:        ;行写入模式
 JSR FC_PPU_Set_Addr
 LDY FC_PPU_Buffer,X
FC_PPU_CountLine_Write:
 INX
 LDA FC_PPU_Buffer,X
 STA $2007
 DEY
 BNE FC_PPU_CountLine_Write
 JMP FC_PPU_Mode_Select
 
;----------------------------------------
FC_PPU_Mode_CountClear:       ;行清除模式
 JSR FC_PPU_Write_Addr
 LDY FC_PPU_Buffer,X
 LDA #$00
FC_PPU_CountClear_Write:
 STA $2007
 DEY
 BNE FC_PPU_CountClear_Write
 JMP FC_PPU_Mode_Select
 
;----------------------------------------
FC_PPU_Mode_CountNext:      ;转行写入模式
 JSR FC_PPU_Set_Next
FC_PPU_CountNext_Write:
 LDA FC_PPU_Addr_H
 STA $2006
 LDA FC_PPU_Addr_L
 STA $2006
 INX
 LDY FC_PPU_Buffer,X
 JMP FC_PPU_CountLine_Write

;----------------------------------------
FC_PPU_Mode_CountSpace: ;转行空格写入模式
 JSR FC_PPU_Set_Next
FC_PPU_Mode_CountSpace_Write:
 INX
 LDA FC_PPU_Addr_H
 STA $2006
 LDA FC_PPU_Addr_L
 AND #$E0
 CLC
 ADC FC_PPU_Buffer,X
 STA FC_PPU_Addr_L
 STA $2006
 INX
 LDY FC_PPU_Buffer,X
 JMP FC_PPU_CountLine_Write

;----------------------------------------
FC_PPU_Set_Addr:                ;写入地址
 INX
 LDA FC_PPU_Buffer,X
 STA FC_PPU_Addr_H
 STA $2006
 INX
 LDA FC_PPU_Buffer,X
 STA FC_PPU_Addr_L
 STA $2006
 INX
 RTS

;----------------------------------------
FC_PPU_Write_Addr:              ;写入地址
 INX
 LDA FC_PPU_Buffer,X
 STA $2006
 INX
 LDA FC_PPU_Buffer,X
 STA $2006
 INX
 RTS

;----------------------------------------
FC_PPU_Set_Next:                ;地址转行
 LDA FC_PPU_Addr_L
 CLC
 ADC #$20
 STA FC_PPU_Addr_L
 BCC FC_PPU_Set_Next_End
 INC FC_PPU_Addr_H
FC_PPU_Set_Next_End:
 RTS

;========================================
FC_PPU_Source_Write_Buffer:     ;写入PPU缓冲数据
 LDA (FC_Data_L),Y
 STA FC_PPU_Buffer,X
 INX
 INY
 RTS

;========================================
SRC_MODE_NULL  = $FF      ;无地址写入模式
;----------------------------------------
FC_PPU_Write_Source:          ;源数据写入
 PHA
 TXA
 PHA
 TYA
 PHA
 LDX FC_PPU_Cursor
 LDY #$00
 LDA FC_Data_Cnt
 STY FC_Data_Cnt
 INC FC_Data_Cnt
 CMP #SRC_MODE_NULL
 BNE FC_PPU_Write_Line
 JSR FC_PPU_Source_Write_Buffer
 STA FC_Data_Cnt
FC_PPU_Write_Source_Set:
 JSR FC_PPU_Source_Write_Buffer
 DEC FC_Data_Cnt
 BNE FC_PPU_Write_Source_Set
FC_PPU_Write_Line:
 LDA (FC_Data_L),Y
 CMP #MODE_CNTL
 BNE FC_PPU_Write_Next
 JSR FC_PPU_Source_Write_Buffer
 JSR FC_PPU_Source_Write_Buffer
 JSR FC_PPU_Source_Write_Buffer
 JSR FC_PPU_Source_Write_Buffer
 STA FC_Data_Cnt
 BNE FC_PPU_Write_Source_Set
FC_PPU_Write_Next:
 CMP #MODE_CNTN
 BNE FC_PPU_Write_Space
 JSR FC_PPU_Source_Write_Buffer
 JSR FC_PPU_Source_Write_Buffer
 STA FC_Data_Cnt
 BNE FC_PPU_Write_Source_Set
FC_PPU_Write_Space:
 CMP #MODE_CNTS
 BNE FC_PPU_Write_Clear
 JSR FC_PPU_Source_Write_Buffer
 JSR FC_PPU_Source_Write_Buffer
 JSR FC_PPU_Source_Write_Buffer
 STA FC_Data_Cnt
 BNE FC_PPU_Write_Source_Set
FC_PPU_Write_Clear:
 CMP #MODE_CNTC
 BNE FC_PPU_Write_Source_End
 JSR FC_PPU_Source_Write_Buffer
 JSR FC_PPU_Source_Write_Buffer
 BNE FC_PPU_Write_Line
FC_PPU_Write_Source_End:
 STX FC_PPU_Cursor
 LDA #$00
 STA FC_Data_Cnt
 PLA
 TAY
 PLA
 TAX
 PLA
 RTS

;========================================
FC_PPU_Source_Write:     ;写入PPU缓冲数据
 STA FC_PPU_Buffer,X
 INX
 INY
 RTS

;========================================
FC_PPU_Clear_Source:          ;源数据清除
 PHA
 TXA
 PHA
 TYA
 PHA
 LDX FC_PPU_Cursor
 LDY #$00
 LDA FC_Data_Cnt
 STY FC_Data_Cnt
 INC FC_Data_Cnt
 CMP #SRC_MODE_NULL
 BNE FC_PPU_Clear_Line
FC_PPU_Clear_Source_Set:
 LDA (FC_Data_L),Y
 STA FC_PPU_Buffer,X
 TYA
 CLC
 ADC (FC_Data_L),Y
 TAY
 INX
 INY
FC_PPU_Clear_Line:
 LDA (FC_Data_L),Y
 CMP #MODE_CNTL
 BNE FC_PPU_Clear_Next
 LDA #MODE_CNTC
 JSR FC_PPU_Source_Write
 LDA (FC_Data_L),Y
 STA FC_PPU_Addr_H
 JSR FC_PPU_Source_Write
 LDA (FC_Data_L),Y
 STA FC_PPU_Addr_L
 JSR FC_PPU_Source_Write
 JMP FC_PPU_Clear_Source_Set
FC_PPU_Clear_Next:
 CMP #MODE_CNTN
 BNE FC_PPU_Clear_Space
 JSR FC_PPU_Set_Next
 LDA #MODE_CNTC
 STA FC_PPU_Buffer,X
 INX
 LDA FC_PPU_Addr_H
 STA FC_PPU_Buffer,X
 INX
 LDA FC_PPU_Addr_L
 JSR FC_PPU_Source_Write
 JMP FC_PPU_Clear_Source_Set
FC_PPU_Clear_Space:
 CMP #MODE_CNTS
 BNE FC_PPU_Clear_Clear
 JSR FC_PPU_Set_Next
 INY
 LDA #MODE_CNTC
 STA FC_PPU_Buffer,X
 INX
 LDA FC_PPU_Addr_H
 STA FC_PPU_Buffer,X
 INX
 LDA FC_PPU_Addr_L
 AND #$E0
 CLC
 ADC (FC_Data_L),Y
 STA FC_PPU_Addr_L
 JSR FC_PPU_Source_Write
 JMP FC_PPU_Clear_Source_Set
FC_PPU_Clear_Clear:
 CMP #MODE_CNTC
 BNE FC_PPU_Clear_Source_End
 JSR FC_PPU_Source_Write
 LDA (FC_Data_L),Y
 JSR FC_PPU_Source_Write
 LDA (FC_Data_L),Y
 JSR FC_PPU_Source_Write
 LDA (FC_Data_L),Y
 JSR FC_PPU_Source_Write
 JMP FC_PPU_Clear_Line
FC_PPU_Clear_Source_End:
 STX FC_PPU_Cursor
 LDA #$00
 STA FC_Data_Cnt
 PLA
 TAY
 PLA
 TAX
 PLA
 RTS

;========================================
ButtonProcess:                  ;按键扫描
 LDX #$01
 STX $4016
 DEX
 STX $4016
ButtonScan
 LDY #$08
ButtonScanBeg:
 LDA $4016,X
 LSR
 ROL Btn_Once,X
 LSR
 DEY
 BNE ButtonScanBeg
ButtonSet: 
 LDA Btn_Once,X
 TAY
 EOR Btn_Keep,X
 AND Btn_Once,X
 STA Btn_Once,X
 TYA
 STA Btn_Keep,X
;----------------------------------------
ButtonDelay:                ;按键长按延迟
 LDA Btn_Keep
 BEQ ButtonDelayEnd
 CMP #$10
 BEQ ButtonDelayEnd
 LDA Btn_Delay
 CMP #BTN_DELAY_TIME
 BCS ButtonDelayPress
 INC Btn_Delay
 RTS
ButtonDelayPress:
 INC Btn_Delay
 LDA Btn_Delay
 SEC
 SBC #BTN_DELAY_TIME
 CMP #BTN_DELAY_SPEED
 BCS ButtonDelayFinish
 RTS
ButtonDelayFinish:
 LDA Btn_Keep
 STA Btn_Once
 LDA #BTN_DELAY_TIME
ButtonDelayEnd:
 STA Btn_Delay
 RTS

;========================================
HexToDec:            ;8位十六进制转十进制
 LDY #$00
 BCC Count100
 INY
 SBC #100
Count100:
 CMP #100
 BCC Set100
 SBC #100
 INY
 BNE Count100
Set100:
 STY DEC_100
 LDY #$00
Count010:
 CMP #10
 BCC Set010
 SBC #10
 INY
 BNE Count010
Set010:
 STY DEC_010
 STA DEC_001
 RTS

;========================================
ChrSteup:                     ;图形块设置
 LDX #$00
ChrSteupSet:
 STX $8000
 LDA Chr_Bank_Data,X
 STA $8001
 INX
 CPX #$06
 BCC ChrSteupSet
 RTS

;========================================
PaletteClear:                 ;调色板清空
 LDA #$3F
 STA $2006
 LDA #$00
 STA $2006
 LDX #$00
 LDA #$0F
PaletteClearSet:
 STA $2007
 INX
 CPX #$20
 BCC PaletteClearSet
 RTS

;========================================
NameTableClear:               ;命名表清空
 LDA #$20
 STA $2006
 LDA #$00
 STA $2006
 LDX #$00
 LDY #$00
 LDA #$00
NameTableClearSet:
 STA $2007
 INX
 BNE NameTableClearSet
 INY
 CPY #10
 BCC NameTableClearSet
 RTS

;========================================
PaletteSteup:             ;背景调色板设置
 LDA #$3F
 STA $2006
 LDA #$00
 STA $2006
 LDX #$00
PaletteSteupSet:
 LDA Palette_Data,X
 STA $2007
 INX
 CPX #$10
 BCC PaletteSteupSet
 RTS

;========================================
PpuLayoutSteup:               ;属性表配置
 LDA #$23
 STA $2006
 LDA #$C0
 STA $2006
 LDX #$00
PpuLayoutSteupSet:
 LDA PpuLayout_Data,X
 STA $2007
 INX
 CPX #$40
 BCC PpuLayoutSteupSet
 RTS
 
;========================================
GetPageIndex:                 ;计算页索引
 LDA #$00
 STA Item_Page_Cur
 LDA Item_Index_Cur
 CMP #ITEM_PAGE
 BCC GetPageIndexReturn
 LDA #$00
 CLC
GetPageIndexSet:
 ADC #ITEM_PAGE
 BCS GetPageMaxIndex
 CMP Item_Index_Cur
 BEQ GetPageIndexEnd
 BCS GetPageIndexReturn
 STA Item_Page_Cur
 BNE GetPageIndexSet
GetPageIndexEnd:
 STA Item_Page_Cur
GetPageIndexReturn:
 RTS
GetPageMaxIndex:
 LDA #ITEM_PAGE_MAX
 STA Item_Page_Cur
 RTS
 
;========================================
SaveOldSelect:              ;保存历史索引
 LDA Item_Page_Cur
 STA Item_Page_Old
 LDA Item_Index_Cur
 STA Item_Index_Old
 RTS

;========================================
SetLastPage:              ;设置上一页索引
 JSR SaveOldSelect
 LDA #ITEM_MAX
 CMP #ITEM_PAGE
 BCS SetLastPageMul
 LDA #$00
 STA Item_Index_Cur
 RTS
SetLastPageMul:
 LDA Item_Index_Cur
 CMP #ITEM_PAGE
 BCC SetMaxPage
 SEC
 SBC #ITEM_PAGE
 STA Item_Index_Cur
 RTS
SetMaxPage:
 LDA #ITEM_PAGE_MAX
 CLC
 ADC Item_Index_Cur
 BCS SetLastMaxSet
 CMP #ITEM_MAX
SetLastMaxSet
 BCC SetLastPageSet
 LDA #ITEM_MAX
SetLastPageSet:
 STA Item_Index_Cur
 RTS

;========================================
SetNextPage:              ;设置下一页索引
 JSR SaveOldSelect
 LDA #ITEM_MAX
 CMP #ITEM_PAGE
 BCS SetNextPageMul
 LDA #ITEM_PAGE - 1
 STA Item_Index_Cur
 RTS
SetNextPageMul:
 LDA Item_Index_Cur
 CMP #ITEM_PAGE_MAX
 BCS SetNext
 CLC
 ADC #ITEM_PAGE
 BCS SetNextMaxSet
 CMP #ITEM_MAX
 BCC SetNextSet
SetNextMaxSet
 LDA #ITEM_MAX
SetNextSet:
 STA Item_Index_Cur
 RTS
SetNext:
 LDA Item_Index_Cur
 SEC
 SBC #ITEM_PAGE_MAX
 STA Item_Index_Cur
 RTS

;========================================
SetLastItem:              ;设置上一项索引
 JSR SaveOldSelect
 LDA Item_Index_Cur
 BEQ SetMaxItem
 LDA Item_Index_Cur
 CMP Item_Page_Cur
 BNE SetLastItemSet
SetLastItemSet:
 DEC Item_Index_Cur
 RTS
SetMaxItem:
 LDA #ITEM_MAX
 STA Item_Index_Cur
 JSR GetPageIndex
 RTS

;========================================
SetNextItem:              ;设置下一项索引
 JSR SaveOldSelect
 LDA Item_Index_Cur
 CMP #ITEM_MAX
 BEQ SetMinItem
 LDA Item_Page_Cur
 CLC
 ADC #ITEM_PAGE -1
 CMP Item_Index_Cur
 BNE SetNextItemSet
SetNextItemSet:
 INC Item_Index_Cur
 RTS
SetMinItem:
 LDA #$00
 STA Item_Index_Cur
 JSR GetPageIndex
 RTS

;========================================
SetOrderPos:                ;设置序号位置
 LDY Item_Index_Cnt
 LDA Pos_Data_H,Y
 STA FC_PPU_Buffer,X
 INX
 LDA Pos_Data_L,Y
 STA FC_PPU_Buffer,X
 INX
 LDA #ORDER_INDEX_LENGTH + 1
 STA FC_PPU_Buffer,X
 INX
 RTS

;========================================
ClearOrder:                     ;清除序号
 LDA Item_Page_Cur
 CMP Item_Page_Old
 BEQ ClearOrderEnd
 LDA Item_Page_Old
 CLC
 ADC Item_Index_Cnt
 BCS ClearOrderEnd
 CMP #ITEM_MAX
 BEQ ClearOrderSet
 BCS ClearOrderEnd
ClearOrderSet:
 LDX FC_PPU_Cursor
 LDA #MODE_CNTC
 STA FC_PPU_Buffer,X
 INX
 JSR SetOrderPos
ClearOrderWrite:
 STX FC_PPU_Cursor
ClearOrderEnd:
 RTS

;========================================
WriteNum:                       ;写入数字
 TAY
WriteNumSet:
 LDA DEC_100,Y
 CLC
 ADC #CHAR_DIGIT
 STA FC_PPU_Buffer,X
 INX
 INY
 CPY #$03
 BCC WriteNumSet
 RTS

;========================================
ShowOrder:                      ;显示序号
 LDA Item_Page_Cur
 CLC
 ADC Item_Index_Cnt
 BCS ShowOrderEnd
 CMP #ITEM_MAX
 BEQ ShowOrderSet
 BCS ShowOrderEnd
ShowOrderSet:
 CLC
 ADC #NMUBER_LENGTH_MAX - ORDER_INDEX_LENGTH
 JSR HexToDec
 LDX FC_PPU_Cursor
 LDA #MODE_CNTL
 STA FC_PPU_Buffer,X
 INX
 JSR SetOrderPos
 LDA #NMUBER_LENGTH_MAX - ORDER_INDEX_LENGTH
 JSR WriteNum
 LDA #CHAR_POINT
 STA FC_PPU_Buffer,X
 INX
 STX FC_PPU_Cursor
ShowOrderEnd:
 RTS
 
;========================================
UpdateOrder:                    ;更新序号
 JSR ClearOrder
 JSR ShowOrder
 RTS

;========================================
SetTextPos:                 ;设置文本位置
 LDY Item_Index_Cnt
 LDA Pos_Data_H,Y
 STA FC_PPU_Buffer,X
 STA FC_PPU_Addr_H
 INX
 LDA Pos_Data_L,Y
 CLC
 ADC #ORDER_INDEX_LENGTH + 1
 STA FC_PPU_Buffer,X
 STA FC_PPU_Addr_L
 INX
 RTS

;========================================
ClearText:                      ;清除文本
 LDA Item_Page_Cur
 CMP Item_Page_Old
 BEQ ClearTextEnd
 LDA Item_Page_Old
 CLC
 ADC Item_Index_Cnt
 BCS ClearTextEnd
 CMP #ITEM_MAX
 BEQ ClearTextSet
 BCS ClearTextEnd
ClearTextSet:
 LDX FC_PPU_Cursor
 LDA #MODE_CNTC
 STA FC_PPU_Buffer,X
 INX
 JSR SetTextPos
 STX FC_PPU_Cursor
 LDA Item_Page_Old
 CLC
 ADC Item_Index_Cnt
 TAY
 LDA Text_Data_L,Y
 STA FC_Data_L
 LDA Text_Data_H,Y
 STA FC_Data_H
 LDA #SRC_MODE_NULL
 STA FC_Data_Cnt
 JSR FC_PPU_Clear_Source
ClearTextEnd:
 RTS

;========================================
ShowText:                       ;显示文本
 LDA Item_Page_Cur
 CLC
 ADC Item_Index_Cnt
 BCS ShowTextEnd
 CMP #ITEM_MAX
 BEQ ShowTextSet
 BCS ShowTextEnd
ShowTextSet:
 LDX FC_PPU_Cursor
 LDA #MODE_CNTL
 STA FC_PPU_Buffer,X
 INX
 JSR SetTextPos
 STX FC_PPU_Cursor
 LDA Item_Page_Cur
 CLC
 ADC Item_Index_Cnt
 TAY
 LDA Text_Data_L,Y
 STA FC_Data_L
 LDA Text_Data_H,Y
 STA FC_Data_H
 LDA #SRC_MODE_NULL
 STA FC_Data_Cnt
 JSR FC_PPU_Write_Source
ShowTextEnd:
 RTS

;========================================
UpdateText:                     ;更新文本
 JSR ClearText
 JSR ShowText
 RTS

;========================================
ShowTitle:                      ;显示标题
 LDA #<Title_Text_Data
 STA FC_Data_L
 LDA #>Title_Text_Data
 STA FC_Data_H
 JSR FC_PPU_Write_Source
ShowTitleEnd:
 JSR NmiDelay
 RTS

;========================================
SetArrowPos:                ;设置箭头位置
 TAY
 LDA Pos_Data_H,Y
 STA FC_PPU_Buffer,X
 INX
 LDA Pos_Data_L,Y
 SEC
 SBC #$02
 STA FC_PPU_Buffer,X
 INX
 LDA #$01
 STA FC_PPU_Buffer,X
 INX
 RTS

;========================================
ShowArrow:                      ;显示箭头
ShowArrowClear:
 LDX FC_PPU_Cursor
 LDA #MODE_CNTL
 STA FC_PPU_Buffer,X
 INX
 LDA Item_Index_Old
 SEC
 SBC Item_Page_Old
 JSR SetArrowPos
 LDA #CHAR_NULL
 STA FC_PPU_Buffer,X
 INX
ShowArrowShow:
 LDA #MODE_CNTL
 STA FC_PPU_Buffer,X
 INX
 LDA Item_Index_Cur
 SEC
 SBC Item_Page_Cur
 JSR SetArrowPos
 LDA #CHAR_ARROW
 STA FC_PPU_Buffer,X
 INX
 STX FC_PPU_Cursor
 RTS

;========================================
UpdateArrow:                    ;更新箭头
 LDA Item_Index_Old
 SEC
 SBC Item_Page_Old
 STA FC_Data_Cnt
 LDA Item_Index_Cur
 SEC
 SBC Item_Page_Cur
 CMP FC_Data_Cnt
 BEQ UpdateArrowEnd
 JSR ShowArrow
UpdateArrowEnd:
 RTS

;========================================
ShowSingleItem:             ;显示一项内容
 JSR UpdateOrder
 JSR UpdateText
 JSR UpdateSoundIndex
ShowSingleItemEnd:
 RTS

;========================================
ShowPageItems:              ;显示一页内容
 LDA #$00
 STA Item_Index_Cnt
 STA Item_Write_Buf
ShowPageItemsSet:
 JSR ShowSingleItem
 INC Item_Write_Buf
 LDA Item_Write_Buf
 CMP #ITEM_BUFFER_SIZE
 BCC ShowPageItemsWrite
 JSR NmiDelay
 LDA #$00
 STA Item_Write_Buf
ShowPageItemsWrite:
 INC Item_Index_Cnt
 LDA Item_Index_Cnt
 CMP #ITEM_PAGE
 BCC ShowPageItemsSet
 LDA Item_Write_Buf
 BEQ ShowPageItemsEnd
 JSR NmiDelay
 LDA #$00
 STA Item_Write_Buf
ShowPageItemsEnd:
 RTS

;========================================
UpdatePage:                   ;更新页内容
 LDA Item_Page_Cur
 CMP Item_Page_Old
 BEQ UpdatePageEnd
 JSR ShowPageItems
 JSR ShowPageIndex
UpdatePageEnd:
 RTS

;========================================
ChangeItemIndex:              ;改变项索引
 LDA Btn_Once
 AND #$FF
 BNE SelectLastSound
 RTS
SelectLastSound:
 LDA Btn_Once
 CMP #BTN_LEFT
 BNE SelectNextSound
 JSR SoundPlayLast
 JSR SaveOldSelect
SelectNextSound:
 LDA Btn_Once
 CMP #BTN_RIGHT
 BNE SelectLastItem
 JSR SoundPlayNext
 JSR SaveOldSelect
SelectLastItem:
 LDA Btn_Once
 CMP #BTN_UP
 BNE SelectNextItem
 JSR SetLastItem
 JSR GetPageIndex
 JSR SoundSelect
SelectNextItem:
 LDA Btn_Once
 CMP #BTN_DOWN
 BNE SelectLastTenSound
 JSR SetNextItem
 JSR GetPageIndex
 JSR SoundSelect
SelectLastTenSound:
 LDA Btn_Once
 CMP #BTN_B
 BNE SelectNextTenSound
 JSR SoundPlayLast10
SelectNextTenSound:
 LDA Btn_Once
 CMP #BTN_A
 BNE SelectNextPage
 JSR SoundPlayNext10
SelectNextPage:
 LDA Btn_Once
 CMP #BTN_SELECT
 BNE SelectReplay
 JSR SetNextPage
 JSR GetPageIndex
 JSR SoundSelect
SelectReplay:
 LDA Btn_Once
 CMP #BTN_START
 BNE ChangeItemIndexEnd
 JSR SoundSelect
ChangeItemIndexEnd:
 JSR UpdatePage
 JSR UpdateArrow
ChangeItemIndexReturn:
 RTS

;========================================
SoundInitIndex:           ;音乐索引初始化
 LDX #$00
SoundInitIndexSet:
 LDA Sound_Start,X
 SEC
 SBC #$01
 STA Sound_Index,X
 INX
 CPX #ITEM_MAX + $01
 BCC SoundInitIndexSet
 RTS
 
;========================================
SoundClear:                     ;音乐清理
 JSR StopSound
 LDX #$00
 LDA #$00
SoundClear_0100_01BF:
 STA $0100,X
 INX
 CPX #$C0
 BNE SoundClear_0100_01BF
 LDX #$00
SoundClear_0200_07FF:
 STA $00,X
 STA $0300,X
 STA $0400,X
 STA $0500,X
 STA $0600,X
 STA $0700,X
 INX
 BNE SoundClear_0200_07FF
 RTS

;========================================
SoundBankSet:               ;音乐Bank设置
 LDA Sound_8000_Data,X
 STA Sound_8000_Addr
 LDA Sound_A000_Data,X
 STA Sound_A000_Addr
 RTS

;========================================
SetSoundIndexPos:           ;设置序号位置
 LDY Item_Index_Cnt
 LDA Pos_Data_H,Y
 STA FC_PPU_Buffer,X
 STA FC_PPU_Addr_H
 INX
 LDA Pos_Data_L,Y
 CLC
 ADC #$43
 STA FC_PPU_Buffer,X
 STA FC_PPU_Addr_L
 BCC SetSoundIndexPosBeg
 INC FC_PPU_Addr_H
 DEX
 INC FC_PPU_Buffer,X
 INX
SetSoundIndexPosBeg:
 INX
 RTS

;========================================
ClearSoundIndex:            ;清除曲目序号
 LDA Item_Page_Old
 CLC
 ADC Item_Index_Cnt
 BCS ClearSoundIndexEnd
 CMP #ITEM_MAX
 BEQ ClearSoundIndexSet
 BCS ClearSoundIndexEnd
ClearSoundIndexSet:
 LDX FC_PPU_Cursor
 LDA #MODE_CNTC
 STA FC_PPU_Buffer,X
 INX
 JSR SetSoundIndexPos
 LDA #SOUND_INDEX_LENGTH * 2 + 1
 STA FC_PPU_Buffer,X
 INX
 STX FC_PPU_Cursor
ClearSoundIndexEnd:
 RTS
;========================================
ShowSoundIndex:             ;显示曲目序号
 LDA Item_Page_Cur
 CLC
 ADC Item_Index_Cnt
 BCS ShowSoundIndexEnd
 CMP #ITEM_MAX
 BEQ ShowSoundIndexSet
 BCS ShowSoundIndexEnd
ShowSoundIndexSet:
 LDX FC_PPU_Cursor
 LDA #MODE_CNTL
 STA FC_PPU_Buffer,X
 INX
 JSR SetSoundIndexPos
 LDA #SOUND_INDEX_LENGTH * 2 + 1
 STA FC_PPU_Buffer,X
 INX
 LDA Item_Page_Cur
 CLC
 ADC Item_Index_Cnt
 TAY
 LDA Sound_Index,Y
 CLC
 ADC #$01
 JSR HexToDec
 LDA #NMUBER_LENGTH_MAX - SOUND_INDEX_LENGTH
 JSR WriteNum
 LDA #CHAR_PER
 STA FC_PPU_Buffer,X
 INX
 LDA Item_Page_Cur
 CLC
 ADC Item_Index_Cnt
 TAY
 LDA Sound_Sum,Y
 JSR HexToDec
 LDA #NMUBER_LENGTH_MAX - SOUND_INDEX_LENGTH
 JSR WriteNum 
 STX FC_PPU_Cursor
ShowSoundIndexEnd:
 RTS

;========================================
UpdateSoundIndex:             ;更新曲目号
 JSR ClearSoundIndex
 JSR ShowSoundIndex
 RTS

SoundProgram:
;========================================
SoundBankProgram:         ;音乐程序块切换
 LDX #$06
 STX $8000
 LDA Sound_8000_Addr
 STA $8001
 INX
 STX $8000
 LDA Sound_A000_Addr
 STA $8001
 RTS

;========================================
MenuBankProgram:          ;菜单程序块切换
 LDA #$06
 STA $8000
 LDA #MENU_BANK
 STA $8001
 RTS

;========================================
SoundPlayProgram:           ;菜单播放程序
 PHA
 JSR Sound_Bank_Process
 PLA
 JSR Sound_Port
 JSR Menu_Bank_Process
 RTS
SoundProgramEnd:

;========================================
InitSoundProcess:         ;初始化音乐程序
 LDX #$00
InitSoundProcessSet:
 LDA SoundProgram,X
 STA Sound_Bank_Process,X
 INX
 CPX #SOUND_PROCESS_SIZE
 BCC InitSoundProcessSet
 RTS

;========================================
SoundSelect:                    ;音乐选择
 JSR SoundClear
 LDA Item_Index_Cur
 SEC
 SBC Item_Page_Cur
 STA Item_Index_Cnt
 JSR ShowSoundIndex
 LDX Item_Index_Cur
 JSR SoundBankSet
 LDA Sound_Init_L,X
 STA Sound_Port_L
 LDA Sound_Init_H,X
 STA Sound_Port_H
 LDA Sound_Index,X
 JSR Sound_Play_Addr
 RTS
 
;========================================
SoundPlay:                      ;音乐播放
 LDX Item_Index_Cur
 JSR SoundBankSet
 LDA Sound_Play_L,X
 STA Sound_Port_L
 LDA Sound_Play_H,X
 STA Sound_Port_H
 JSR Sound_Play_Addr
 RTS
 
;========================================
StopSound:                      ;停止音乐
 LDA #$0B
 STA $4015
 LDA #$00
 STA $4008
 LDA #$0F
 STA $4015
 LDA #$30
 STA $4000
 STA $4004
 STA $400C
 LDA #$7F
 STA $4001
 STA $4005
 RTS

;========================================
SoundPlayLast:                    ;上一曲
 LDX Item_Index_Cur
 LDA Sound_Index,X
 BEQ SoundPlayLastEnd
 DEC Sound_Index,X
 JSR SoundSelect
SoundPlayLastEnd:
 RTS

;========================================
SoundPlayNext:                    ;下一曲
 LDX Item_Index_Cur
 LDA Sound_Index,X
 CLC
 ADC #01
 CMP Sound_Sum,X
 BCS SoundPlayNextEnd
 INC Sound_Index,X
 JSR SoundSelect
SoundPlayNextEnd:
 RTS

;========================================
SoundPlayLast10:                  ;上10曲
 LDX Item_Index_Cur
 LDA Sound_Index,X
 BEQ SoundPlayLast10End
 CMP #10
 LDA #$00
 BCC SoundPlayLast10Set
 LDA Sound_Index,X
 SEC
 SBC #10
SoundPlayLast10Set:
 STA Sound_Index,X
 JSR SoundSelect
SoundPlayLast10End:
 RTS

;========================================
SoundPlayNext10:                  ;下10曲
 LDX Item_Index_Cur
 LDA Sound_Index,X
 CLC
 ADC #$01
 CMP Sound_Sum,X
 BEQ SoundPlayNext10End
 LDA Sound_Index,X
 CLC
 ADC #10
 CMP Sound_Sum,X
 BCC SoundPlayNext10Set
 LDA Sound_Sum,X
 SEC
 SBC #$01 
SoundPlayNext10Set:
 STA Sound_Index,X
 JSR SoundSelect
SoundPlayNext10End:
 RTS

;========================================
SetPageIndexPos:            ;设置页号位置
 LDX FC_PPU_Cursor
 LDY #$00
 LDA Title_Text_Data,Y
 STA FC_PPU_Buffer,X
 INX
 INY
 LDA Title_Text_Data,Y
 STA FC_PPU_Buffer,X
 INX
 INY
 LDA Title_Text_Data,Y
 INY
 CLC
 ADC Title_Text_Data,Y
 ADC #$02
 STA FC_PPU_Buffer,X
 INX
 LDA #PAGE_INDEX_LENGTH * 2 + 1
 STA FC_PPU_Buffer,X
 INX
SetPageIndexPosEnd:
 STX FC_PPU_Cursor
 RTS

;========================================
ShowPageIndex:                  ;显示页号
 LDA Item_Page_Cur
 LDX #$01
ShowPageIndexSet:
 CMP #ITEM_PAGE
 BCC ShowPageIndexEnd
 SEC
 SBC #ITEM_PAGE
 INX
 BNE ShowPageIndexSet
ShowPageIndexEnd:
 TXA
 CLC
 JSR HexToDec
 JSR SetPageIndexPos
 LDA #NMUBER_LENGTH_MAX - PAGE_INDEX_LENGTH
 JSR WriteNum
 LDA #CHAR_PER
 STA FC_PPU_Buffer,X
 INX
 LDA #ITEM_PAGE_SUM
 CLC
 JSR HexToDec
 LDA #NMUBER_LENGTH_MAX - PAGE_INDEX_LENGTH
 JSR WriteNum
 STX FC_PPU_Cursor
 RTS

;========================================
Chr_Bank_Data:                  ;图形块号
 .DB $00,$02,$04,$05,$06,$07

;========================================
Palette_Data:             ;背景调色板数据
 .DB $0F,$24,$24,$24,$0F,$20,$20,$20,$0F,$27,$27,$27,$0F,$2C,$2C,$2C

;========================================
PpuLayout_Data:               ;属性表数据
 .DB $AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$FF,$55,$A0,$A0,$A0,$A0,$A0,$A0
 .DB $FF,$55,$A0,$A0,$A0,$A0,$A0,$A0,$FF,$55,$A0,$A0,$A0,$A0,$A0,$A0
 .DB $FF,$55,$A0,$A0,$A0,$A0,$A0,$A0,$FF,$55,$A0,$A0,$A0,$A0,$A0,$A0
 .DB $FF,$55,$A0,$A0,$A0,$A0,$A0,$A0,$AA,$AA,$AA,$AA,$AA,$AA,$AA,$AA

;========================================
Pos_Data_L:             ;节目坐标位置低位
 .DB $85,$05,$85,$05,$85,$05
Pos_Data_H:;节目坐标位置高位
 .DB $20,$21,$21,$22,$22,$23

;========================================
Text_Data_L:            ;节目文本地址低位
 .DB <ITEM_001,<ITEM_002,<ITEM_003,<ITEM_004,<ITEM_005,<ITEM_006,<ITEM_007,<ITEM_008,<ITEM_009,<ITEM_010
 .DB <ITEM_011,<ITEM_012,<ITEM_013,<ITEM_014,<ITEM_015,<ITEM_016,<ITEM_017,<ITEM_018,<ITEM_019,<ITEM_020
 .DB <ITEM_021,<ITEM_022,<ITEM_023,<ITEM_024,<ITEM_025,<ITEM_026,<ITEM_027,<ITEM_028,<ITEM_029,<ITEM_030

;----------------------------------------
Text_Data_H:            ;节目文本地址高位
 .DB >ITEM_001,>ITEM_002,>ITEM_003,>ITEM_004,>ITEM_005,>ITEM_006,>ITEM_007,>ITEM_008,>ITEM_009,>ITEM_010
 .DB >ITEM_011,>ITEM_012,>ITEM_013,>ITEM_014,>ITEM_015,>ITEM_016,>ITEM_017,>ITEM_018,>ITEM_019,>ITEM_020
 .DB >ITEM_021,>ITEM_022,>ITEM_023,>ITEM_024,>ITEM_025,>ITEM_026,>ITEM_027,>ITEM_028,>ITEM_029,>ITEM_030

;========================================
Title_Text_Data:            ;标题文本数据
 .DB MODE_CNTL,$20,$45
 .STR "FC CAPCOM 30 IN 1"

;========================================
YEAR_INDENT = $30
;========================================
Text_Data:                      ;节目文本
ITEM_001 .STR "ROCKMAN 1"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1987"
ITEM_002 .STR "ROCKMAN 2"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1988"
ITEM_003 .STR "ROCKMAN 3"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1990"
ITEM_004 .STR "ROCKMAN 4"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1991"
ITEM_005 .STR "ROCKMAN 5"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1992"
ITEM_006 .STR "ROCKMAN 6"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1993"
ITEM_007 .STR "ROCKMAN BOARD GAME"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1993"
ITEM_008 .STR "1943"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1988"
ITEM_009 .STR "CHIP & DALE 1"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1990"
ITEM_010 .STR "CHIP & DALE 2"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1993"
ITEM_011 .STR "DESTINY OF AN EMPEROR 1"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1989"
ITEM_012 .STR "DESTINY OF AN EMPEROR 2"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1991"
ITEM_013 .STR "DUCK TALES 1"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1989"
ITEM_014 .STR "DUCK TALES 2"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1993"
ITEM_015 .STR "MIGHTY FINAL FIGHT"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1993"
ITEM_016 .STR "GUN SMOKE"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1988"
ITEM_017 .STR "CODE NAME: VIPER"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1989"
ITEM_018 .STR "TOP SECRET"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1988"
ITEM_019 .STR "DARKWING DUCK"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1992"
ITEM_020 .STR "LEGENDARY WINGS"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1988"
ITEM_021 .STR "MAKAIJIMA"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1987"
ITEM_022 .STR "RED ARIIMAA 2"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1992"
ITEM_023 .STR "STREET FIGHTER 2010"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1990"
ITEM_024 .STR "THE LITTLE MERMAID"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1991"
ITEM_025 .STR "THE DREAM MASTER"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1990"
ITEM_026 .STR "SWEET HOME"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1989"
ITEM_027 .STR "STRIDER HIRYU"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1938"
ITEM_028 .STR "WILLOW"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1989"
ITEM_029 .STR "THE MAGIC KINGDOM"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1990"
ITEM_030 .STR "SECTION Z"
 .DB MODE_CNTS,YEAR_INDENT
 .STR "1987"

;========================================
Sound_Sum:                      ;曲目总数
 .DB 051,067,057,071,076,102,118,045,126,116,051,043,056,020,054,048,047,062,128,033,032,035,046,019,045,040,038,049,046,028
;========================================
Sound_Start:                    ;默认曲目
 .DB 006,009,008,010,008,005,001,001,001,001,033,001,001,001,001,001,001,062,001,006,001,001,001,001,001,001,001,015,001,019
;========================================
Sound_Init_L:             ;初始化地址低位
 .DB $03,$03,$03,$03,$03,$03,$03,$03,$03,$C0,$03,$03,$03,$C0,$03,$03,$03,$C0,$03,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0,$C0
Sound_Init_H:             ;初始化地址高位
 .DB $90,$80,$80,$80,$80,$80,$80,$80,$80,$BF,$80,$80,$80,$BF,$80,$80,$80,$BF,$80,$BF,$BF,$BF,$BF,$BF,$BF,$BF,$BF,$BF,$BF,$9F
;========================================
Sound_Play_L:               ;播放地址低位
 .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
Sound_Play_H:               ;播放地址高位
 .DB $90,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$90,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80
;========================================
Sound_8000_Data:       ;音乐$8000页Bank号
 .DB $00,$02,$04,$07,$0A,$0D,$10,$12,$14,$16,$18,$1A,$1C,$1E,$20,$22,$24,$26,$28,$2A,$2C,$2E,$30,$32,$34,$36,$38,$3A,$3C,$3E
Sound_A000_Data:       ;音乐$8000页Bank号
 .DB $01,$03,$05,$08,$0B,$0E,$11,$13,$15,$17,$19,$1B,$1D,$1F,$21,$23,$25,$27,$29,$2B,$2D,$2F,$31,$33,$35,$37,$39,$3B,$3D,$3F
[FC][卡普空音乐30合1][20190518].zip
(260.87 KiB) Downloaded 324 times
Last edited by FlameCyclone on Sat May 18, 2019 5:03 am, edited 1 time in total.

kuja killer
Posts: 91
Joined: Mon May 25, 2009 2:20 pm

Re: [FC][FC CAPCOM 30 IN 1]

Post by kuja killer » Sat May 18, 2019 4:39 am

really fooled me for a minute, i seriously thought this was 30 games in 1, and i was going to say... no freaking way in the universe the 6 megaman games can fit in 768 kb ..not even 2 of them...

then i load it up and its actually a music player instead with all the game's individual music engines about every 4000 bytes or so... alright then, that makes sense.

FlameCyclone
Posts: 13
Joined: Fri Jun 02, 2017 2:45 am

Re: [FC][FC CAPCOM 30 IN 1]

Post by FlameCyclone » Sat May 18, 2019 5:06 am

kuja killer wrote:really fooled me for a minute, i seriously thought this was 30 games in 1, and i was going to say... no freaking way in the universe the 6 megaman games can fit in 768 kb ..not even 2 of them...

then i load it up and its actually a music player instead with all the game's individual music engines about every 4000 bytes or so... alright then, that makes sense.
You are right, this is a capcom game music collection.

NewRisingSun
Posts: 1068
Joined: Thu May 19, 2005 11:30 am

Re: [FC][FC CAPCOM MUSIC 30 IN 1]

Post by NewRisingSun » Mon May 20, 2019 1:40 pm

The music speed is slightly uneven on real hardware (with an Everdrive N8) because the player just polls $2002 for NMI timing, which is subject to the NMI race condition. This is most noticable on Rockman 1 song 2, and 1943 song 1.

Post Reply