; Made by Alessandro Lo-Presti (Agilo) on Januari 22, 2008. ; Enable rumble feature when pressing C button. .orgfill 0x1460 ; Start of General Purpose RAM. .orgfill 0x2100 ; Start of ROM space. .db "MN" ; ROM ID (do not change or validation will fail). .include "irq.asm" ; Game cart IRQ vectors. ; Pokemon Mini game header. .orgfill 0x219E ; 0x219E - 0x21A3 must be empty. .orgfill 0x21A4 ; Start of "NINTENDO" string. .db "NINTENDO" ; Magic signature checked by the BIOS. .db "RMBL" ; Game code, 4 bytes. .db "RumbleOnC" ; Name of ROM, 12 chars max. .orgfill 0x21BC ; Will contain the following string: .db "2P" ; At this time it's unknown what "2P" stands for. .orgfill 0x21D0 ; End of rom header, start of program code. .include "irqhandlers.asm" ; Game cart IRQ routine handlers. ; Code entry point. start: movw sp, 0x2000 ; Set SP to end of general purpose RAM (stack grows down). movw nn, 0x2000 ; NN register points to hardware registers. ; Enable primary interrupts on all keys. movb [nn+0x21], 0x0C ; Enable secondary interrupt for the power button (CPU will jump to 0x215C). movb [nn+0x25], 0x80 ; Clear all flags. movb flags, 0 ; Logics start here. game_end: ; Check if C-button was pressed and rumble if so. test [nn+0x52], (1<<2) jnz _disable_rumble ; Enable rumble. or [nn+0x61], 0x10 jmp game_end _disable_rumble: ; Disable rumble. movb [nn+0x61], 0x64 jmp game_end