Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ For other TODO items, recommend using the github issue system
================================================================

================================================================
Features that have not been ported yet
Features that are being ported now
================================================================

- Capture Cropping
Expand All @@ -24,6 +24,8 @@ Features that have not been ported yet

- Phantoon always visible

- Random bubble SFX

- Randomize on load

- Randomize RNG shortcut
Expand All @@ -39,17 +41,23 @@ and there isn't much benefit in porting or backporting them

- Resources folder structure and unusued resources

- Order of included sources
- Order of included sources and bank freespace locations

- Structure of defines.asm and main.asm (and separating printdebug.asm from main.asm)

- The SM Practice Hack title screen (the difference helps identify which practice hack is being used)

- Various sound effect macros

- Walk Through Walls option
- Walk Through Walls option and unfinished dboost infohud mode

- Detect emulator inaccuracy developer option

- The taller menu (this is available as a build option)

- Leading > or arrow on menu items, or menuing layout and text differences in general

- Leading > or arrow on menu items, or menuing differences in general
- Differences in how menu options can be scrolled through

- AREA_ID stored in custom presets

Expand Down
9 changes: 5 additions & 4 deletions layout/layoutmenutemplate.asm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

pushpc
%startfree(E4)

; -------------------------
Expand All @@ -9,8 +8,8 @@ pushpc

LayoutMenu:
dw #layout_itempickups
dw #$FFFF
dw #layout_bombtorizodoor
dw #layout_steamcollision
dw #layout_magnetstairs
dw #layout_arearando
dw #layout_antisoftlock
Expand Down Expand Up @@ -322,8 +321,11 @@ layout_bombtorizodoor:
db #$28, "r SLOW", #$FF
db #$FF

layout_steamcollision:
%cm_toggle_bit("Remove Steam Collision", !sram_room_layout, !ROOM_LAYOUT_NO_STEAM_COLLISION, #0)

layout_magnetstairs:
%cm_toggle_bit("Remove Magnet Stairs", !sram_room_layout, !ROOM_LAYOUT_MAGNET_STAIRS, #0)
%cm_toggle_bit("Remove Magnet Stairs", !sram_room_layout, !ROOM_LAYOUT_NO_MAGNET_STAIRS, #0)

layout_arearando:
%cm_toggle_bit("Area Rando Patches", !sram_room_layout, !ROOM_LAYOUT_AREA_RANDO, #0)
Expand Down Expand Up @@ -870,4 +872,3 @@ portals_down_vanilla_table:


%endfree(E4)
pullpc
10 changes: 8 additions & 2 deletions resources/ntsc_to_pal_abridged_pseudo_patch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ org $80FFD9
; Bank 81
;=======================================================

; Freespace
org $81EF1A

; Thanks
org $81FF00

; Freespace
org $81FF60

Expand Down Expand Up @@ -2673,7 +2679,7 @@ org $9BC645
org $9BCBFB

; Samus tiles
org $9BCBFB
org $9BE000

; Freespace (used by SpriteSomething)
org $9BFDA0
Expand Down Expand Up @@ -4887,7 +4893,7 @@ org $C2B5E4
org $C2B6BB

; Freespace
org $CEB22D
org $CEB22E

;=======================================================
; Bank CF
Expand Down
2 changes: 1 addition & 1 deletion src/BRBmenu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ brb_menu_palette_cycle:
%cm_toggle_bit_inverted("Cycle Palettes", !ram_cm_brb_palette, #$FFFF, #0)

brb_menu_scroll:
%cm_toggle("Screen Scrolling", !ram_cm_brb_scroll, #$0001, #0)
%cm_toggle("Screen Scrolling", !ram_cm_brb_scroll, #$01, #0)

brb_menu_music_toggle:
dw !ACTION_CHOICE
Expand Down
6 changes: 3 additions & 3 deletions src/crash.asm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
; This resource adds a crash handler to dump data to SRAM
; whenever one of these "crash vectors" is triggered

pushpc

; Hijack generic crash handler
org $808573
hook_crash_handler:
Expand Down Expand Up @@ -185,7 +183,7 @@ COPHandler:

%endfree(80)

pullpc
%startfree(89)

CrashViewer:
{
Expand Down Expand Up @@ -1125,3 +1123,5 @@ CrashTextInfo11:
; Press LRSlSt to soft reset
db "Press ", #$8D, #$8C, #$85, #$84, " to soft reset", #$FF

%endfree(89)

174 changes: 174 additions & 0 deletions src/cropmenu.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@

%startfree(8E)

; ----------------
; Capture Cropping
; ----------------

CaptureCroppingMenu:
dw #ccm_launch_crop_mode
dw #$FFFF
dw #ccm_crop_mode
dw #ccm_crop_tile
dw #$0000
%cm_header("CAPTURE CROPPING MODE")

ccm_launch_crop_mode:
%cm_jsl("Capture Crop Mode", .routine, #0)
.routine
JSL cm_crop_mode
JML refresh_cgram_long

ccm_crop_mode:
dw !ACTION_CHOICE
dl #!ram_cm_crop_mode
dw #$0000
db #$28, "Drawing Method", #$FF
db #$28, " BORDER", #$FF
db #$28, " FILL", #$FF
db #$FF

ccm_crop_tile:
dw !ACTION_CHOICE
dl #!ram_cm_crop_tile
dw #$0000
db #$28, "Cropping Tile", #$FF
db #$28, " ", #$90, #$FF
db #$28, " ", #$91, #$FF
db #$FF

cm_crop_mode:
{
PHP : %a16() : %i8()

; turn on forced blank
LDX #$80 : STX $2100

; fix BG3 scroll offset
LDX #$FF : STX $2112
LDX #$03 : STX $2112

TDC : STA !ram_crash_palette

; pattern or solid color?
LDA !ram_cm_crop_tile : BEQ .boxes
LDA #$2891 : STA $C1
BRA .draw

.boxes
LDA #$2890 : STA $C1

.draw
; wait for lag frame
LDX !NMI_COUNTER : CPX !NMI_COUNTER : BEQ .draw

; draw around the border or fill the screen?
LDA !ram_cm_crop_mode : BNE .fill
JSR cm_crop_border
BRA .drawingdone

.fill
JSR cm_crop_fill

.drawingdone
; turn off forced blank
LDX #$0F : STX $2100

.loop
; Make sure we don't read joysticks twice in the same frame
; wait for lag frame
LDX !NMI_COUNTER : CPX !NMI_COUNTER : BEQ .loop
LDA !FRAME_COUNTER : CMP !ram_cm_input_counter : PHP
STA !ram_cm_input_counter
PLP : BNE .inputRead
JSL $809459 ; Read controller input

.inputRead
LDA !IH_CONTROLLER_PRI_NEW : BEQ .loop
CMP !CTRL_B : BEQ .end
CMP !CTRL_L : BEQ .decPalette
CMP !CTRL_R : BEQ .incPalette
BRA .loop

.decPalette
LDA !ram_crash_palette : BNE .decSetPalette
LDA #$0008
.decSetPalette
DEC : STA !ram_crash_palette
JSL crash_cgram_transfer
BRA .loop

.incPalette
LDA !ram_crash_palette : CMP #$0007 : BMI .incSetPalette
LDA #$FFFF
.incSetPalette
INC : STA !ram_crash_palette
JSL crash_cgram_transfer
BRA .loop

.end
; restore BG3 scroll offset
LDA !REG_2112_BG3_Y
%ai8()
LDX #$80 : STX $2100
STA $2112 : XBA : STA $2112
LDX #$0F : STX $2100

PLP
RTL
}

cm_crop_border:
{
; top
LDX #$80 : STX $2115
LDA #$5800 : STA $2116
LDA $C1 : LDX #$00
.topLoop
STA $2118
INX : CPX #$20 : BNE .topLoop

; bottom
LDX #$80 : STX $2115
LDA #$5B60 : STA $2116
LDA $C1 : LDX #$00
.bottomLoop
STA $2118
INX : CPX #$40 : BNE .bottomLoop

; left
LDX #$81 : STX $2115
LDA #$5820 : STA $2116
LDA $C1 : LDX #$00
.leftLoop
STA $2118
INX : CPX #$1D : BNE .leftLoop

; right
LDX #$81 : STX $2115
LDA #$583F : STA $2116
LDA $C1 : LDX #$00
.rightLoop
STA $2118
INX : CPX #$1D : BNE .rightLoop

RTS
}

cm_crop_fill:
{
LDX #$80 : STX $2115
LDA #$5800 : STA $2116
PHP : %i16()
LDA $C1 : LDX #$0400

.loop
STA $2118
DEX : BPL .loop

PLP
RTS
}

%endfree(8E)

Loading