An intro screen is the player’s entry point: it presents a game title and can wait for Fire before play begins. It can also introduce enemies, high scores, settings, extra information, or a demo sequence. section 1.5.2
On the NES, an intro screen is assembled from fixed 8 × 8 tile patterns loaded from ROM into video memory. Sprites can add smaller objects in front of or behind the tiled background. section 1.5.2
A simple title-screen implementation proceeds as follows:
- Wait for rendering to finish and disable rendering before changing PPU video memory. section 6.7
- Clear the nametable, then set PPU addresses for the title and prompt locations. section 6.7
- Write zero-terminated text strings through a reusable text-writing routine, then update the PPU to show the result. section 6.7
- Run a loop that waits for controller input; while waiting, it may animate, play music, or advance to another information screen. section 1.5.2
Mega Blast title screen
A minimal screen clears the display, writes “M E G A B L A S T” near the top, writes “PRESS FIRE TO BEGIN” lower down, and uses attribute-table data to apply palette sections. After it is displayed, the program enables background and sprite rendering and enters its main loop. section 6.7
Listing 6.16 Completing the display title screen function (megablast.s)
.segment "ZEROPAGE"
paddr: .res 2 #1
.segment "CODE"
title_text:
.byte "M E G A B L A S T",0
press_play_text:
.byte "PRESS FIRE TO BEGIN",0
title_attributes:
.byte %00000101,%00000101,%00000101,%00000101
.byte %00000101,%00000101,%00000101,%00000101
.proc display_title_screen
jsr ppu_off #2
jsr clear_nametable #3
vram_set_address (NAME_TABLE_0_ADDRESS + 4 * 32 + 6) #4
assign_16i text_address, title_text
jsr write_text
vram_set_address (NAME_TABLE_0_ADDRESS + 20 * 32 + 6) #5
assign_16i text_address, press_play_text
jsr write_text
vram_set_address (ATTRIBUTE_TABLE_0_ADDRESS + 8) #6
assign_16i paddr, title_attributes
ldy #0
loop:
lda (paddr),y
sta PPU_VRAM_IO
iny
cpy #8
bne loop
jsr ppu_update #7
rts
.endproc
This listing shows the complete title-screen routine: clearing the nametable, positioning each text string, writing it, and filling attribute-table bytes for palette selection. section 6.7
