VOGONS


unaligned handlers(all of them.)

Topic actions

Reply 20 of 23, by ih8registrations

User metadata
Rank Oldbie
Rank
Oldbie

Need the page boundary checks for what? Was there an intent or use for the boundary checks, or is it simply just the way things are currently written that happen to require boundary checks?

Reply 21 of 23, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Simple example: page 0x9f is regular ram, page 0xa0 is vga memory.
A word write to 0x9ff0:0xff has to write one byte to the regular memory
(host_write stuff) and one byte using a call to the vga memory handler.

Reply 23 of 23, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Yeh but you still can't get rid of the <0xffd 😀
One thing to completely remove this check (which, alas, wasn't faster, too)
i tried some time ago for the generated inlined memory functions was to
rotate the lowest two bits (dword access) into the highest two bits of a
linear address, then extracting the page. This page number has a range
4x larger due to the two additional bits, so the tlb tables are 4x larger as
well. All entries of the translation buffer that have either of the highest bits
set (ie. non-dword alignment of the access) are zero, and special treatment
along with the handler-case is done. In the normal case the ram is just
accessed, in total this gives for the latter ("regular") case only one comparison,
the one to see if it's a handler-case or not.
Maybe along with handler-only memory access you can make something
nice out of this...