Skip to content

Commit

Permalink
alex won't like me using his tmp function outside of nmi
Browse files Browse the repository at this point in the history
  • Loading branch information
UserSniper committed Jun 26, 2024
1 parent 4807b51 commit 526ac49
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LIB/asm/crt0.s
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ _famistudio_state = *
.segment "CHR_BANK_00"
.export _CHR_MENU_GLOBAL
_CHR_MENU_GLOBAL:
.incbin "GRAPHICS/new_chr/menu.chr" ; (512 bytes)
.incbin "GRAPHICS/new_chr/menu.chr" ; (4kb)



Expand Down
2 changes: 2 additions & 0 deletions LIB/asm/mapper.s
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ MMC3_REG_PRG_RAM_PROTECT = $a001
_mmc3_set_prg_bank_1:
STA mmc3PRG1Bank
mmc3_tmp_prg_bank_1: ; ONLY MEANT FOR USE WITH NMI-RELATED TEMPORARY BANKSWITCHING
_mmc3_tmp_prg_bank_1:
PHA
lda #MMC3_REG_SEL_PRG_BANK_1
.export _mmc3_tmp_prg_bank_1
mmc3_internal_set_bank:
ora mmc3ChrInversionSetting
sta MMC3_REG_BANK_SELECT
Expand Down
11 changes: 9 additions & 2 deletions SAUCE/functions/chr_loading.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#define FIRST_CHR_BANK 32

extern void mmc3_tmp_prg_bank_1();
extern const unsigned char CHR_MENU_GLOBAL[];




// data: name of the array
// bytes: amount of bytes to write x256
// where: which 256 byte segment to write to
void verybadchrload(uint8_t* data, uint8_t bytes, uint8_t where){

mmc3_tmp_prg_bank_1(FIRST_CHR_BANK); // THIS DOES NOT EXIST IN THE C SPACE FSR //
mmc3_tmp_prg_bank_1(FIRST_CHR_BANK);
// womp womp, here we go iguess

// start at the beginning
Expand All @@ -14,7 +21,7 @@ void verybadchrload(uint8_t* data, uint8_t bytes, uint8_t where){
tmp6 = (bytes << 8);
for(tmp5 = 0; tmp5 < tmp6; tmp5++){
tmp1 = data[tmp5];
POKE(0x2007, data);
POKE(0x2007, tmp1);
}


Expand Down
2 changes: 1 addition & 1 deletion SAUCE/gamestates/state_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ void state_menu() {

//mmc3_set_8kb_chr(MENUBANK);
mmc3_set_8kb_chr(0);
verybadchrload(&CHR_MENU_GLOBAL, 4, 0);
verybadchrload(CHR_MENU_GLOBAL, 16, 0);

set_scroll_x(0);
set_scroll_y(0);
Expand Down

0 comments on commit 526ac49

Please sign in to comment.