; The first half of the ROM will not be used, so PAD it FILLVALUE $FF ORG $0000 PAD $8000 LCD_INS EQU $6000 LCD_DAT EQU $6001 DELAY_CNT EQU $0010 Init: LDA #$38 STA LCD_INS JSR WaitLcd JSR Delay LDA #$38 STA LCD_INS JSR WaitLcd JSR Delay LDA #$38 STA LCD_INS JSR WaitLcd JSR Delay LDA #$38 STA LCD_INS JSR WaitLcd JSR Delay ; On/Off control LDA #$0C STA LCD_INS JSR WaitLcd JSR Delay ; Clear display LDA #$01 STA LCD_INS JSR WaitLcd JSR Delay ; Entry Mode Set LDA #$06 STA LCD_INS JSR WaitLcd JSR Delay ; Set DDRAM Address LDA #$80 STA LCD_INS JSR WaitLcd JSR Delay ; Move A character to LCD ;LDA #$41 ;STA LCD_DAT ;JSR WaitLcd ;JSR Delay JSR WriteMessage MainLoop: NOP NOP NOP NOP JMP MainLoop ; Wait until LCD is not busy WaitLcd: LDA #$80 BIT LCD_INS BNE WaitLcd RTS Delay: LDA #$00 STA DELAY_CNT Delay_1: ADC #$01 CMP #$00 BNE Delay_1 INC DELAY_CNT LDA #$10 CMP DELAY_CNT BNE Delay_1 RTS WriteMessage: LDY #$00 WriteMessage_0: LDA (MSG),Y CMP #$00 BEQ WriteMessage_End STA LCD_DAT JSR WaitLcd INY JMP WriteMessage_0 WriteMessage_End: RTS MSG DB "+------------------+" DB "| Nintendo DS |" DB "| Better than a |" DB "+------------------+" DB $00 ; At the very end (almost), we need to declare where the PC should be initialized at. ; For our purposes, we'll start it at the beginning of the ROM area. ORG $FFFC DB $00, $80, $00, $00