Dwedit's Board

Enjoy the board

You are not logged in.

Announcement

User passwords may have been corrupted, if you can't log in, use the "Forgot Password" feature. If you still can't log in, contact me and I can try to manually reset your password.

#1 2023-07-14 10:05:07 am

devolov
Member
Registered: 2023-07-14
Posts: 1

How to save novblankwait into a config?

I cannot find the correct avenue to pose this question, so I'll ask here:

How can I save novblankwait into the config?
I see that cfg->misc seems to have enough space for the 2 bits novblankwait needs, but I cannot find where I can set the default to what's in the config.
Attempt 1:
I tried testing and setting novblankwait = 2; at the end of readconfig
Nothing changed.

		request_gb_type = (i & 0x0C)>>2;		//restore current request_gb_type setting
		autostate = (i & 0x10)>>4;				//restore current autostate setting
		gammavalue = (i & 0xE0)>>5;				//restore current gamma setting
		sram_owner=cfg->sram_checksum;
+		novblankwait = 2;;
	}
}

Attempt 2:
I tried setting novblankwait to 2 as a default as a sanity check, but that did not cause the game to default to slomo (2 is slomo)

novblankwait:
-    .byte 0 @novblankwait_
+    .byte 1 @novblankwait_
Attempt 3:
In timeout.s, I tried to make a function that calls vblset as a test. The idea is that at the 0th frame, we can read novblankwait in the config and set it. That somehow did nothing. Though I do not know if I'm missing something.

line0:
	adr_ r2,cpuregs
	stmia r2,{gb_flg-gb_pc,gb_sp}	@save gbz80 state
	
	ldrb_ r0,autoborderstate
	cmp r0,#1
	bne 0f
	ldr_ r0,frame
	ldr_ r1,auto_border_reboot_frame
	cmp r0,r1
	blt 0f
	bl_long loadcart_after_sgb_border
+	ldr r1,=vblset
+	bx r1
0:

Offline

#2 2023-07-15 1:38:05 pm

Dwedit
Administrator
From: Chicago
Registered: 2004-12-12
Posts: 1,018
Website

Re: How to save novblankwait into a config?

Currently, calling the "run" function causes novblankwait to be set to 0.  This happens after the game is loaded and all configuration has been loaded.  So it basically does not read it from the configuration at all.

@----------------------------------------------------------------------------
run:	@r0=0 to return after frame
@----------------------------------------------------------------------------
	tst r0,#1
	stmeqfd sp!,{gb_flg-gb_pc,globalptr,r11,lr}

	ldr globalptr,=GLOBAL_PTR_BASE
	strb_ r0,dontstop_
	mov r1,#0
	strb_ r1,novblankwait_

	b_long line0x

"We are merely sprites that dance at the beck and call of our button pressing overlord."

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman