What is the advantage of switching screen resolution from a DLL, rather than Blitz?
The Blitz bank structure is simply two memory buffers. The first one is the actual bank variable, and is always size 12. Here is the structure:
0 - C function pointer (don't worry about it, I just make it 0)
4 - pointer to second memory buffer
8 - size of second memory buffer
When a bank is resized, the pointer at position 4 might become a totally different memory buffer, but the bank variable still works because it doesn't change.
Pseudo code:
The Blitz bank structure is simply two memory buffers. The first one is the actual bank variable, and is always size 12. Here is the structure:
0 - C function pointer (don't worry about it, I just make it 0)
4 - pointer to second memory buffer
8 - size of second memory buffer
When a bank is resized, the pointer at position 4 might become a totally different memory buffer, but the bank variable still works because it doesn't change.
Pseudo code:
Procedure BankAddress(bank) Return PeekL(bank,4) EndProcedure Procedure BankSize(bank) Return PeekL(bank,8) EndProcedure Procedure ResizeBank(bank,size) pointer=PeekL(bank,4) freememory pointer newpointer=AllocateMemory(size) PokeL bank,4,newpointer PokeL bank,8,size EndProcedure