; INES header stuff .inesprg 128 * 1024 ; 8 banks of PRG = 128kB .ineschr 0 ; no CHR, RAM only .inesmir 0 ; horizontal mirroring .inesmap 2 ; UxROM ; default settings ; enable main sounds .ifndef ENABLE_SOUND ENABLE_SOUND .equ 1 .endif ; number of stars .ifndef STARS STARS .equ 30 .endif ; stars direction (0 - down to up, 1 - up to down) .ifndef STARS_DIRECTION STARS_DIRECTION .equ 1 .endif ; star spawn interval .ifndef STAR_SPAWN_INTERVAL STAR_SPAWN_INTERVAL .equ 90 .endif ; remember last started game .ifndef ENABLE_LAST_GAME_SAVING ENABLE_LAST_GAME_SAVING .equ 1 .endif ; show right cursor .ifndef ENABLE_RIGHT_CURSOR ENABLE_RIGHT_CURSOR .equ 1 .endif ; game names offset from the left .ifndef GAME_NAMES_OFFSET GAME_NAMES_OFFSET .equ 1 .endif ; time before button autorepeat .ifndef BUTTON_REPEAT_FRAMES BUTTON_REPEAT_FRAMES .equ 30 .endif ; minimum number of games for screen wrap feature .ifndef WRAP_GAMES WRAP_GAMES .equ 30 .endif ; enable dim-in (on startup, etc) .ifndef ENABLE_DIM_IN ENABLE_DIM_IN .equ 1 .endif ; dim-in speed (more - slower) .ifndef DIM_IN_DELAY DIM_IN_DELAY .equ 5 .endif ; enable dim-out (before game launch, etc) .ifndef ENABLE_DIM_OUT ENABLE_DIM_OUT .equ 1 .endif ; dim-out speed (more - slower) .ifndef DIM_OUT_DELAY DIM_OUT_DELAY .equ 1 .endif ; save cursor position immediately .ifndef INSTANT_STATE_SAVE INSTANT_STATE_SAVE .equ 1 .endif .ifndef GAMES_DB GAMES_DB .sequ "games.asm" .endif .ifndef MENU_HEADER_PATTERN_TABLE_BIN MENU_HEADER_PATTERN_TABLE_BIN .sequ "menu_header_pattern_table.bin" .endif .ifndef MENU_HEADER_NAME_TABLE_BIN MENU_HEADER_NAME_TABLE_BIN .sequ "menu_header_name_table.bin" .endif .ifndef MENU_HEADER_ATTRIBUTE_TABLE_BIN MENU_HEADER_ATTRIBUTE_TABLE_BIN .sequ "menu_header_attribute_table.bin" .endif .ifndef MENU_HEADER_BG_PALETTE_0 MENU_HEADER_BG_PALETTE_0 .sequ "bg_palette0.bin" .endif .ifndef MENU_HEADER_BG_PALETTE_1 MENU_HEADER_BG_PALETTE_1 .sequ "bg_palette1.bin" .endif .ifndef MENU_HEADER_BG_PALETTE_2 MENU_HEADER_BG_PALETTE_2 .sequ "bg_palette2.bin" .endif ; games settings .include GAMES_DB ; sprites data .rsset $0400 SPRITES .rs 256 ; non-volatile PRG-RAM .rsset $6000 SRAM_SIGNATURE .rs 8 SRAM_LAST_STARTED_GAME .rs 2 SRAM_LAST_STARTED_LINE .rs 2 SRAM_LAST_STARTED_SAVE .rs 1 .rsset $0000 ; zero page variables ; some common variables COPY_SOURCE_ADDR .rs 2 COPY_DEST_ADDR .rs 2 TMP .rs 2 ; selected game SELECTED_GAME .rs 2 .bank 15 ; last bank .org $FFFA ; vectors .dw NMI ; NMI vector .dw Start ; reset vector .dw IRQ ; interrupts .org $FFE0 unrom_bank_data: ; for compatibility with UNROM and UNROM's bus conflicts .db $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0A, $0B, $0C, $0D, $0E, $0F .org $E000 Start: sei ; no interrupts ; reset stack ldx #$ff txs ; disable and reset sound jsr reset_sound ; disable PPU lda #%00000000 sta PPUCTRL sta PPUMASK ; warm-up jsr waitblank_simple jsr waitblank_simple ; load black screen jsr load_black ; clean memory lda #$00 sta > 8) & $FF bne .not_single_game stx =1 lda #%00010011 cmp > 8) & $FF sta =2 lda #%00100011 cmp > 8) & $FF adc #0 sta