diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 12c1f08..6c9a95e 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -23,6 +23,7 @@ Text conversion: Masaru Sterophonick Normmatt + KillThad Special thanks: TragicManner diff --git a/makefile b/makefile new file mode 100644 index 0000000..c9f747c --- /dev/null +++ b/makefile @@ -0,0 +1,2 @@ +default: + pwsh.exe .\build.ps1 \ No newline at end of file diff --git a/src/data/intro-screen-gfx.bin b/src/data/intro-screen-gfx.bin new file mode 100644 index 0000000..92245eb Binary files /dev/null and b/src/data/intro-screen-gfx.bin differ diff --git a/src/data/intro-screen-map.bin b/src/data/intro-screen-map.bin new file mode 100644 index 0000000..6eab23e Binary files /dev/null and b/src/data/intro-screen-map.bin differ diff --git a/src/data/intro-screen-pal.bin b/src/data/intro-screen-pal.bin new file mode 100644 index 0000000..7dcf3e5 Binary files /dev/null and b/src/data/intro-screen-pal.bin differ diff --git a/src/data/m2-door-bubble.bin b/src/data/m2-door-bubble.bin new file mode 100644 index 0000000..896e881 Binary files /dev/null and b/src/data/m2-door-bubble.bin differ diff --git a/src/data/m2-insane-cultist.bin b/src/data/m2-insane-cultist.bin new file mode 100644 index 0000000..1c77f4c Binary files /dev/null and b/src/data/m2-insane-cultist.bin differ diff --git a/src/data/m2-ness-pajamas.bin b/src/data/m2-ness-pajamas.bin new file mode 100644 index 0000000..6a3bb8f Binary files /dev/null and b/src/data/m2-ness-pajamas.bin differ diff --git a/src/data/m2-nusutto-sign.bin b/src/data/m2-nusutto-sign.bin new file mode 100644 index 0000000..6c3208d Binary files /dev/null and b/src/data/m2-nusutto-sign.bin differ diff --git a/src/data/m2-runaway-five.bin b/src/data/m2-runaway-five.bin new file mode 100644 index 0000000..00b1905 Binary files /dev/null and b/src/data/m2-runaway-five.bin differ diff --git a/src/m12-intro.asm b/src/m12-intro.asm new file mode 100644 index 0000000..484739a --- /dev/null +++ b/src/m12-intro.asm @@ -0,0 +1,119 @@ +REG_DISPCNT equ 0x04000000 //Display Control, 16-bit +REG_DISPSTAT equ 0x04000004 //General LCD Status +REG_BG0CNT equ 0x04000008 //BG0 Control +REG_IME equ 0x04000208 //Interrupt Master Enable Register +REG_IE equ 0x04000200 //Interrupt Enable Register +REG_IF equ 0x04000202 //Interrupt Request Flags / IRQ Acknowledge +REG_BLDCNT equ 0x04000050 //Color Special Effects Selection +REG_BLDY equ 0x04000054 //Brightness Coefficient +VRAM equ 0x06000000 //Video RAM, 16-bit +BGCRAM equ 0x05000000 //BG Color RAM, 16-bit +REG_KEYINPUT equ 0x04000130 //Key Status +LZ77UnCompVRAM equ #18 + +// Note: THIS IS A TERRIBLE WAY OF DOING THIS STUFF... TOO BAD! + +m12_intro_screen: + push {r0-r4} + ldr r0,=REG_DISPCNT + mov r1,#0xFF + add r1,r1,#1 + strh r1,[r0] + + ldr r0,=REG_DISPSTAT + mov r1,#8 + strh r1,[r0] + + ldr r0,=REG_BG0CNT + mov r1,#0x80 + strh r1,[r0] + + ldr r0,=REG_IME + mov r1,#0x1 + strh r1,[r0] + + ldr r0,=REG_IE + mov r1,#0x1 + strh r1,[r0] + + ldr r0,=REG_IF + mov r1,#0x1 + strh r1,[r0] + + ldr r0,=REG_BLDCNT + mov r1,#0xA1 + strh r1,[r0] + + ldr r0,=REG_BLDY + mov r1,#16 + strh r1,[r0] + + ldr r0,=disclaimer_palette + ldr r1,=BGCRAM + ldr r4,=#256*2 + @@palette: + ldrh r3,[r0,r5] + strh r3,[r1,r5] + add r5,#2 + cmp r5,r4 + bne @@palette + + ldr r2,=#0x100 + ldr r0,=disclaimer_map + ldr r1,=VRAM + ldr r4,=#1280 + @@map: + sub r4,#2 + ldrh r3,[r0,r4] + add r3,r2 + strh r3,[r1,r4] + cmp r4,#0 + bne @@map + + ldr r0,=#disclaimer_graphics + ldr r1,=VRAM+0x4000 + swi LZ77UnCompVRAM + + ldr r2,=REG_BLDCNT + mov r4,#0x10 + @@fadein: + strh r4,[r2,#4] + swi #5 + swi #5 // 15 loops with 2 intrs each gives a total fade-in time of 0.5 seconds + sub r4,#1 + bpl @@fadein + + ldr r2,=REG_KEYINPUT + ldr r4,=#0x3FF + @@loop3: + swi #5 // VBlankIntrWait + ldrh r0,[r2,#0] + cmp r0,r4 + beq @@loop3 + + @@next: + ldr r2,=REG_BLDCNT + mov r4,#0x00 + @@fadeout: + strh r4,[r2,#4] + swi #5 + swi #5 // 15 loops with 2 intrs each gives a total fade-in time of 0.5 seconds + add r4,#1 + cmp r4,#0x11 + bne @@fadeout + + mov r0,#0 + ldr r1,=BGCRAM + ldr r4,=#74 + @@cpal: + sub r4,#2 + strh r0,[r1,r4] + cmp r4,#0 + bne @@cpal + + pop {r0-r4} + push {lr} + ldr r0,=#0x3007FFC + str r1,[r0,#0] + pop {pc} +.pool diff --git a/src/m2-hack.asm b/src/m2-hack.asm index d50c4f0..ca70a13 100644 --- a/src/m2-hack.asm +++ b/src/m2-hack.asm @@ -45,6 +45,12 @@ mov r1,4 mov r2,1 mov r3,6 +//--------------------------------------------------------- +// 00270 hacks (intro screen) +//--------------------------------------------------------- + +.org 0x800027A :: bl m12_intro_screen + //--------------------------------------------------------- // C0A5C hacks (status window) //--------------------------------------------------------- @@ -1856,6 +1862,16 @@ optimized_byte_4bpp_to_1bpp_table: m12_cartridge_palettes_dimmed: .incbin "data/m12-cartridge-palettes-dimmed.bin" +.org 0x8FEE000 +disclaimer_palette: +.incbin "data/intro-screen-pal.bin" +.align 4 +disclaimer_graphics: +.incbin "data/intro-screen-gfx.bin" +.align 4 +disclaimer_map: +.incbin "data/intro-screen-map.bin" + //============================================================================== // Existing subroutines/data @@ -1936,6 +1952,8 @@ m12_cartridge_palettes_dimmed: // Code files //============================================================================== +.include "m2-localize.asm" + .org 0x80FCE6C .include "syscalls.asm" .include "m2-vwf.asm" @@ -1944,5 +1962,6 @@ m12_cartridge_palettes_dimmed: .include "m2-customcodes.asm" .include "m2-compiled.asm" .include "m2-flyover.asm" +.include "m12-intro.asm" .close diff --git a/src/m2-localize.asm b/src/m2-localize.asm new file mode 100644 index 0000000..2ec12c0 --- /dev/null +++ b/src/m2-localize.asm @@ -0,0 +1,10 @@ +.org 0x876c1fc :: .incbin "data/m2-door-bubble.bin" //Door - Don->! +.org 0x8787fbc :: .incbin "data/m2-nusutto-sign.bin" //Nusutto->Burglin Park +.org 0x869ff28 :: .incbin "data/m2-ness-pajamas.bin" //Ness' Pajamas +.org 0x874d4bc :: .incbin "data/m2-runaway-five.bin" //Runaway Five Sprites + +.org 0x8CC6D30 +m2InsaneCultist: +.incbin "data/m2-insane-cultist.bin" + +.org 0x8b1f684 :: .word m2InsaneCultist //Insane Cultist \ No newline at end of file