+-----------------------------------------+ | Specifications for the guests screens | +-----------------------------------------+ | | - -- --- --------------+-------------------------------+--------------- --- -- - ##### GENERAL ##### * The megademo is an Atari ST megademo, like in the good all days, with a main-menu and doors to access to the different guests screens, hidden screen and reset demo... * The screens should work on STF+STE, but can be STE only (a mark on the door will indicate the limitation) * The screens must work with 1 MB memory * Deadline for guest screens is last week of december 2020 - -- --- -------------------------------------------------------------- --- -- - ##### FILE FORMAT ##### * The screens will be submitted in executable format (.TOS) not compressed, they will be automatically packed at built time by the demo builder * The file-size (once compressed with ARJ -m7) should be around 60-100 KB (this is just an indication, so that everyone has their place on the disk(s), but in fact a slight overflow will be tolerated) - -- --- -------------------------------------------------------------- --- -- - ##### EXECUTION ##### * System is disabled: no BIOS/XBIOS/GEMDOS trap call allowed, except : - Supervisor-mode switch (GEMDOS #32) - Supexec-supervisor execute (XBIOS #38) - Pterm0 (GEMDOS #0) - Pterm (GEMDOS #76) which will be diverted by the kernel * Before running the screens, the kernel will ensure to set a safe environment : * screen set to low rez / 50 Hz / address $70000 * sound turned off * MFP cleared : no timer A-B-C-D * a default empty VBL * a default empty HBL * SR set to $2300 * palette cleared (all black) * The kernel setup system stack (~1024 bytes available), but if your screen needs more space on the stack, you will have to allocate it yourself * Use space key (#$39) to leave your demo * Use Pterm, Pterm0 or illegal instruction to leave your demo - -- --- -------------------------------------------------------------- --- -- - ##### MEMORY ORGANIZATION ##### * The area between $200 and $300 contains kernel variables (see list below) * The system area (between $300 and $500) is completely erased at kernel boot-up, and only the vectors essential for reset are kept in this TOS system area, so do not rely on any information provided by the system * Memory map : 0 - $200 : Exception and system vectors (see note below) $200 - $300 : Kernel variables $300 - $500 : System Variables (deactivated !) $500 - $2000 : Kernel (+ stack) $2000 - ~$4000 : Reset demo ~$4000 - ~$7000 : Loading and decrunching screen ~$7000 - ~$15000 : Main menu ~$15000 - $100000 : Your screen Areas marked with a tilde (~) are purely indicative, their size may vary by the time the demo is released * When your screen will be run it will be relocated to an address which may vary depending on external factors set out above * If there is enough space in ram, your screen will be loaded after kernel and resident reset demo and main-menu, so its base address will be something around $10000-$15000. In that case, there is approximately $100000-$15000 = 962,560 b of memory available * If your screen requires more memory, the main-menu will be removed from memory so that your screen takes its place (the main-menu will be reloaded after). In that case, there is approximately $100000-$7000 = 1,019,904 b of memory available * Do not write anything below the address to which your program is loaded, this could prevent certain fundamental parts from working. For added security: do not write anything outside your program Data+BSS areas. * Only exception: you can install your own routines into system vectors : * Auto-Vector Interrupts between $64 and $7C (eg : HBL $68 or VBL $70) * User Assigned Interrupt Vectors between $100 and $140 (eg : timer A $134, timer B $120, timer C $114, timer D $110, etc...) - -- --- -------------------------------------------------------------- --- -- - ##### HOWTO TRACE YOUR PROGRAM ##### To trace the execution of your program inside the Guest Screen Checker, look for a "JSR 28(A6)" at about memory position $11FA. You can place a breakpoint there, it's the place where the kernel is jumping to your program : $000011EE : 21C8 0280 move.l a0,$0280.w $000011F2 : 21CF 0284 move.l sp,$0284.w $000011F6 : 487A 043C pea $1634(pc) $000011FA : 4EAE 001C jsr $1c(a6) ; Run screen $000011FE : 2E78 0284 movea.l $0284.w,sp - -- --- -------------------------------------------------------------- --- -- - +-----------------------------------------+ | Shared variables | +-----------------------------------------+ | | - -- --- --------------+-------------------------------+--------------- --- -- - Address Size Description Name -------+----+-----------------------------------------------------+------------ #################[ SYSTEM VARIABLES ]########################################## -------+----+-----------------------------------------------------+------------ $000204|word|Machine type (bit 0 = 0=STF, 1=STE) |k_machine -------+----+-----------------------------------------------------+------------ $000206|word|Available memory (n=0: 512 KiB, n>0: n MiB) |k_mem_size $000208|long|Start of TPA (user memory) |k_mem_bot $00020C|long|End of TPA (user memory) |k_mem_top -------+----+-----------------------------------------------------+------------ $000214|word|Wakestate mode (STE = 0, STF = 1-4) |k_wakestate -------+----+-----------------------------------------------------+------------ $0002A0|word|Number of vertical blank routines |k_nb_vbl -------+----+-----------------------------------------------------+------------ - -- --- -------------------------------------------------------------- --- -- -