Merge pull request #113 from Sterophonick/master

Add an intro screen, and start on the graphics stuff
This commit is contained in:
jeffman 2020-05-18 16:26:01 -04:00 committed by GitHub
commit f9ce809283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 151 additions and 0 deletions

View File

@ -23,6 +23,7 @@ Text conversion:
Masaru
Sterophonick
Normmatt
KillThad
Special thanks:
TragicManner

2
makefile Normal file
View File

@ -0,0 +1,2 @@
default:
pwsh.exe .\build.ps1

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
src/data/m2-door-bubble.bin Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

119
src/m12-intro.asm Normal file
View File

@ -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

View File

@ -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

10
src/m2-localize.asm Normal file
View File

@ -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