0 Members and 1 Guest are viewing this topic.
Useful indeed =]I might have a fix for you, tVarStrng ($AA) appears to be missing from the list of word tokens.Cheers.
You're welcome.Switching to max CPU speed could be significant, at the very beginning of the app & hook codes.Don't forget to backup af before that if needed, of course :in a,(2)rlcaand 1out (32),aDisabling interrupts is also a thing, and i would even recommend it after each bcall aswell.Cheers.
Is there any kind of "update homescreen" bcall that I can use to make sure it does get displayed?
.db $83 di ld c,a in a,($02) rla jr nc,hook_max_speed ld a,$01 out ($20),ahook_max_speed dec c dec c jr z,hook_evaluate cp a rethook_evaluate bit 5,(iy+$44) jr z,hook_core ld a,$03 ld b,64 ld hl,$DA7E out ($05),a bcall(_savedisp) di xor a out ($05),ahook_core;here goes the code that alters the homescreen entry bit 5,(iy+$44) jr nz,hook_update_mp ld a,(currow) push af bcall(_rstrshadow) di pop af ld (currow),a rethook_update_mp ld a,$03 ld b,64 ld hl,$DA7E out ($05),a bcall(_restoredisp) di xor a out ($05),a ret
Great news, i managed to adapt my code.Note that it's designed to work for a homescreen hook with a=2, i haven't fully tested it with the other contexts.Also, though it works as expected (everything properly displayed after a _clrlcdfull), it might not solve your problem, cause i believe it's not a display issue, more like the fact that the Ans you add should also be added to the list of mp home entries on RAM page 3.Anyway, that will be a good way to tell if i'm right about that.
hook_home.db $83 di ld c,a in a,($02) rla jr nc,hook_home_max_speed ld a,$01 out ($20),ahook_home_max_speed dec c jr nz,hook_home_exit ld a,b cp kenter jr z,hook_home_enterhook_home_exit cp a rethook_home_enter bit 3,(iy+$49) jr nz,hook_home_exit;Here is where you check if you want to add Ans or not.;If yes, jump to hook_home_ans_enter, otherwise return.hook_home_ans_enter ld de,appbackupscreen ld hl,flags+hookflags2 ld a,(hl) ld (de),a or %00000001 ld (hl),a ld bc,3 inc de ld hl,getkeyhookptr ldir ld hl,hook_keyboard ld (getkeyhookptr),hl in a,($06) ld (getkeyhookptr+2),a ld b,kans cp a rethook_keyboard.db $83 di in a,($02) rla jr nc,hook_keyboard_max_speed ld a,$01 out ($20),ahook_keyboard_max_speed ld de,flags+hookflags2 ld hl,appbackupscreen ldi ld bc,3 ld de,getkeyhookptr ldir ld a,kenter cp a ret