Replies: 9 comments 11 replies
-
You could use inlays to expand the level sections: https://github.com/drmortalwombat/oscar64?tab=readme-ov-file#inlays |
Beta Was this translation helpful? Give feedback.
-
I just added a sample for the inlays: https://github.com/drmortalwombat/OscarTutorials/tree/main/4530%20InlayLevels |
Beta Was this translation helpful? Give feedback.
-
I tried to set the inlay data on the easyflash, but the program crashes: What did I wrong? `` // The constant arrays that hold the compressed inlay regions #pragma data ( bdata1 ) const char Inlay0[]; #pragma data ( data ) // The inlay sections // The regions to be compressed into the inlay constants // Structure specifying a level. // Switch to section for first inlay // Entry function of first inlay // Switch to section for second inlay void Entry1(void) #pragma code( icode2 ) void Entry2(void) #pragma code( icode3 ) void Entry3(void) // Now back to shared code // Constand structure with the level information int main(void)
} |
Beta Was this translation helpful? Give feedback.
-
"puts()" uses the kernal for io, so this will be an issue. |
Beta Was this translation helpful? Give feedback.
-
To get the inlays into the bank 1 of the easyflash is a little tricky. An unitialized variable goes per default to the bss section. Specifying it later as an inlay will move it to the code section. So correct would be: #pragma code ( bdata1 ) // The regions to be compressed into the inlay constants #pragma code ( code )` |
Beta Was this translation helpful? Give feedback.
-
You can use __bankof("") to get the bank of the current function. I am using a similar (but template based) method in https://github.com/drmortalwombat/Ninia to get from bank to bank. |
Beta Was this translation helpful? Give feedback.
-
Hello, unfortunatly I could not get it to run. I sorted the functions into 3 different banks with minimal cross-calls (game logic, actors, scenes) and the variables and common functions (also from imported libraries) are in a000-8000. The bank execution is with ROM on, the display functions are NO_ROM. As soon as I run code in the bank it crashes inbetween, I think while accessing global variables. I have no clue what is happing and debugging of crt is also not possible. |
Beta Was this translation helpful? Give feedback.
-
Here is the source code: This contains a working file in main memory only and a easyflash try. It would be nice if you could tell what the issue is with easyflash. Discord I save for later... |
Beta Was this translation helpful? Give feedback.
-
Sounds logically, I need to check my code, probably I read bitmap patterns while Rom is enabled… so I’m glad that the easyflash version is running… gives me up to 1MB 🥳 with bank switching. thanks |
Beta Was this translation helpful? Give feedback.
-
Hello,
maybe someone could help me with my memory setup for a level loading from cartridge, my idea is to have a easyflash or magicdesk setup that all levels are written in C code and are on different banks. One bank can have n levels (i.e. 0x0800 bytes length max). The levels could have a fixed position on the bank (i.e. 0x8000, x8800, x9000 etc.) or the levels have a variable size (which is even better). I would like to have a largemem setup 0xa00-0xd000 in general. I would like to copy the level on a fixed position 0x7000 and execute it. I could not figure out how to make the correct setup:
I tried this, but this is not correct, but maybe gives you an idea:
#pragma section( bcode1, 0 )
#pragma section( bdata1, 0 )
#pragma section( bcode2, 0 )
#pragma section( bdata2, 0 )
#pragma region(bank1, 0x8000, 0xa000, , 1, { bcode1, bdata1, bcode2, bdata2 }, 0x2000 )
#pragma code ( bcode1 )
#pragma data ( bdata1 )
// Print into shared charwin
void print1(void)
{
cwin_put_string(&cw, p"This is first bank 1", 1);
cwin_cursor_newline(&cw);
}
const EntryTable entry1 = {
.fhello = &print1,
};
#pragma reference(entry1)
#pragma code ( bcode2 )
#pragma data ( bdata2 )
void print2(void)
{
cwin_put_string(&cw, p"This is first bank 2", 1);
cwin_cursor_newline(&cw);
}
const EntryTable entry2 = {
.fhello = &print2,
};
#pragma reference(entry2)
#pragma code ( code )
#pragma data ( data )
void callLevel(char bank, char level)
{
// How to get the code address?
memcpy((char *)0x7000, (char *)0x8000, 0x1000);
}
Beta Was this translation helpful? Give feedback.
All reactions