Skip to content

Commit e05e3be

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents bd061ac + b6b30bc commit e05e3be

4 files changed

Lines changed: 32 additions & 9 deletions

File tree

6 Bytes
Binary file not shown.

patches/src/pause_menu_objectives.asm

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ org !bank_85_free_space_start
282282
;;; load objective screen title from ROM to RAM
283283
load_obj_tilemap:
284284
%loadRamDMA(obj_bg1_tilemap, !BG1_tilemap+20, 24)
285-
RTL
285+
RTS
286286

287287
;;; update RAM tilemap with objectives text, line by line
288288
!tmp_tile_offset = $12
@@ -364,12 +364,10 @@ check_objs:
364364
PLX ; X <- objective number
365365
INX
366366
CPX !tmp_tile_offset
367-
BEQ .exit
368-
BRA .obj_check_lp
369-
367+
BNE .obj_check_lp
370368
.exit
371369
PLB
372-
RTL
370+
RTS
373371

374372
check_objective: ; X = index
375373
PHX
@@ -399,7 +397,7 @@ find_next_check:
399397
;;; direct DMA of BG1 tilemap to VRAM
400398
blit_objs:
401399
%gfxDMA(!BG1_tilemap, $30a0, !BG1_tilemap_size)
402-
RTL
400+
RTS
403401

404402
;;; DMA tilemap each frame
405403
queue_obj_tilemap:
@@ -732,12 +730,13 @@ func_map2obj_load_obj:
732730
STZ $B3 ; BG1 Y scroll = 0
733731

734732
STZ !obj_index
735-
JSL load_obj_tilemap
736-
JSL update_objs
737-
JSL blit_objs
733+
JSR load_obj_tilemap
734+
JSR update_objs
735+
JSR blit_objs
738736
LDA !pause_screen_mode_obj
739737
STA !pause_screen_mode ; Pause screen mode = objective screen
740738
%callBank82Func($A615) ; Set pause screen button label palettes
739+
JSR fix_palette ; Fix color used for dark map theme
741740
STZ $073F
742741
LDA $C10C
743742
STA $072B ; $072B = Fh
@@ -921,6 +920,11 @@ sram_to_gfx_dma: ; size in A, src in X (bank hardcoded to $70), dest in Y
921920
STX $0330
922921
RTS
923922

923+
fix_palette:
924+
LDA #$7FFF
925+
STA $7EC04A
926+
RTS
927+
924928
warnpc !bank_85_free_space2_end
925929

926930
org !bank_B6_free_space_start

patches/src/seed_hash_display.asm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ CharTable:
113113
db $79, $7a, $7b, $7c, $7d, $7e, $7f, $80, $81, $82, $83, $0f, $0f, $0f, $0f, $0f
114114
endif
115115

116+
;; This must match the enemy name list in get_seed_hash in maprando_web.
116117
;; ASCII values, A: 41 -> Z: 5A, ' ': 20
117118
WordTable:
118119
db "GEEMER", $00

rust/maprando-web/src/main.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ struct RandomizeRequest {
489489
#[derive(Serialize)]
490490
struct RandomizeResponse {
491491
seed_url: String,
492+
seed_hash: String,
492493
}
493494

494495
struct AttemptOutput {
@@ -798,9 +799,26 @@ async fn randomize(
798799

799800
HttpResponse::Ok().json(RandomizeResponse {
800801
seed_url: format!("/seed/{seed_name}/"),
802+
seed_hash: get_seed_hash(output.randomization.display_seed),
801803
})
802804
}
803805

806+
fn get_seed_hash(display_seed: usize) -> String {
807+
// This must match the enemy name list in seed_hash_display.asm.
808+
let enemies = vec![
809+
"GEEMER", "RIPPER", "ATOMIC", "POWAMP", "SCISER", "NAMIHE", "PUROMI", "ALCOON", "BEETOM",
810+
"OWTCH", "ZEBBO", "ZEELA", "HOLTZ", "VIOLA", "WAVER", "RINKA", "BOYON", "CHOOT", "KAGO",
811+
"SKREE", "COVERN", "EVIR", "TATORI", "OUM", "PUYO", "YARD", "ZOA", "FUNE", "GAMET",
812+
"GERUTA", "SOVA", "BULL",
813+
];
814+
(display_seed as u32)
815+
.to_le_bytes()
816+
.into_iter()
817+
.map(|i| enemies[i as usize % 32].to_string())
818+
.collect::<Vec<String>>()
819+
.join(" ")
820+
}
821+
804822
#[derive(Template)]
805823
#[template(path = "about.html")]
806824
struct AboutTemplate {

0 commit comments

Comments
 (0)