Posted Sun Oct 24, 2010 3:10 AM
Posted Sun Oct 24, 2010 5:14 AM
retroclouds, on Sat Oct 23, 2010 12:36 PM, said:
Posted Mon Oct 25, 2010 12:30 PM
Posted Mon Nov 1, 2010 12:33 PM
* Equates for CONFIG register *-------------------------------------------------------------- * Configuration flags * =================== * * ; 15 Sound player: tune source 1=ROM/RAM 0=VDP MEMORY * ; 14 Sound player: loop tune 1=yes 0=no * ; 13 Sound player: on 1=yes 0=no (or pause) * ; 12 Keyboard: mode 1=real 0=virtual * ; 11 Keyboard: ANY key pressed 1=yes 0=no * ; 10 Keyboard: <<reserved>> 1=yes 0=no * ; 09 Timer: Kernel thread enabled 1=yes 0=no * ; 08 Timer: Block kernel thread 1=yes 0=no * ; 07 Timer: User hook enabled 1=yes 0=no * ; 06 Timer: Block user hook 1=yes 0=no * ; 05 speech player: external voice 1=yes 0=no * ; 04 Speech player: busy 1=yes 0=no * ; 03 Speech player: on 1=yes 0=no * ; 02 VDP9918 PAL version 1=yes(50) 0=no(60) * ; 01 Subroutine state flag 1 1=on 0=off * ; 00 Subroutine state flag 0 1=on 0=off ********@*****@*********************@************************** PALON EQU >2000 ; bit 2=1 (VDP9918 PAL version) ENUSR EQU >0100 ; bit 7=1 (Enable user hook) ENKNL EQU >0040 ; bit 9=1 (Enable kernel thread)
Edited by retroclouds, Mon Nov 1, 2010 12:34 PM.
Posted Mon Nov 1, 2010 12:54 PM
Posted Tue Nov 9, 2010 12:57 PM
********@*****@*********************@************************** AORG >6000 *-------------------------------------------------------------- * Cartridge header *-------------------------------------------------------------- GRMHDR BYTE >AA,1,1,0,0,0 DATA PROG BYTE 0,0,0,0,0,0,0,0 PROG DATA 0 DATA RUNLIB HW BYTE 12 TEXT 'HELLO WORLD!' *-------------------------------------------------------------- * Include required files *-------------------------------------------------------------- COPY "D:\Projekte\spectra2\tms9900\runlib.a99" *-------------------------------------------------------------- * SPECTRA2 startup options *-------------------------------------------------------------- SPVMOD EQU GRAPH1 ; Video mode. See VIDTAB for details. SPFONT EQU FNOPT7 ; Font to load. See LDFONT for details. SPFCLR EQU >F0 ; Foreground/Background color for font. SPFBCK EQU >08 ; Screen background color. *************************************************************** * Main ********@*****@*********************@************************** MAIN BL @PUTYX DATA >0B0A,HW ; Show "Hello World!" message on row >0B, column >0A B @TMGR ; Handle FCTN-QUIT key, etc. END

FNOPT1 EQU >0000 ; LDFONT => Load TI title screen font FNOPT2 EQU >0006 ; LDFONT => Load upper case font FNOPT3 EQU >000C ; LDFONT => Load upper/lower case font FNOPT4 EQU >0012 ; LDFONT => Load lower case font FNOPT5 EQU >8000 ; LDFONT => Load TI title screen font & make fat FNOPT6 EQU >8006 ; LDFONT => Load upper case font & make fat FNOPT7 EQU >800C ; LDFONT => Load upper/lower case font & make fat FNOPT8 EQU >8012 ; LDFONT => Load lower case font & make fat
Posted Tue Nov 9, 2010 1:35 PM
retroclouds, on Tue Nov 9, 2010 12:57 PM, said:
Posted Tue Nov 9, 2010 3:41 PM
Posted Tue Nov 9, 2010 3:54 PM
Posted Wed Nov 10, 2010 5:24 AM
Posted Wed Nov 10, 2010 1:04 PM
Posted Wed Nov 10, 2010 2:22 PM
Vorticon, on Tue Nov 9, 2010 1:35 PM, said:
retroclouds, on Tue Nov 9, 2010 12:57 PM, said:
Posted Fri Nov 12, 2010 2:31 PM
********@*****@*********************@************************** AORG >6000 *-------------------------------------------------------------- * Cartridge header *-------------------------------------------------------------- GRMHDR BYTE >AA,1,1,0,0,0 DATA PROG BYTE 0,0,0,0,0,0,0,0 PROG DATA 0 DATA RUNLIB MSG BYTE 15 TEXT 'MOVE THE SPRITE' *-------------------------------------------------------------- * Include required files *-------------------------------------------------------------- COPY "D:\Projekte\spectra2\tms9900\runlib.a99" *-------------------------------------------------------------- * SPECTRA2 startup options *-------------------------------------------------------------- SPVMOD EQU GRAPH1 ; Video mode. See VIDTAB for details. SPFONT EQU FNOPT7 ; Font to load. See LDFONT for details. SPFCLR EQU >A0 ; Foreground/Background color for font. SPFBCK EQU >01 ; Screen background color. *-------------------------------------------------------------- * Our constans and variables in scratchpad memory *-------------------------------------------------------------- RAMSAT EQU >8340 ; Copy of mini-SAT in RAM memory (6 bytes) RAMTAB EQU >8346 ; Timer table (4 bytes) *************************************************************** * Main ********@*****@*********************@************************** MAIN BL @CPYM2M DATA SPRITE,RAMSAT,6 ; Copy 6 bytes from ROM into scratchpad RAM BL @CPYM2V DATA >1000,PAT1,8 ; Dump sprite pattern BL @PUTBOX DATA >1503,>1A02,MSG1,EOL ; Show text in box on row >15, col >03 with width >1A, height >02. MOV @MYTAB,@WTITAB ; Setup address of timer table BL @MKSLOT DATA >0002,MVBOX,EOL ; Create new timer slot B @TMGR ; Handle FCTN-QUIT key, timers, etc. *************************************************************** * Move sprite: This routine is called as timer slot from TMGR ********@*****@*********************@************************** MVBOX MOV R11,R0 ; Save R11 in R0 COC @WBIT11,CONFIG ; ANY key pressed ? JNE MVBOX5 ; No, so exit MOV @WVRTKB,R1 ; Get keyboard flags MVBOX1 COC @KEY1,R1 ; Left ? JNE MVBOX2 SB @BD2,@RAMSAT+1 ; X=X-2 MVBOX2 COC @KEY2,R1 ; Right ? JNE MVBOX3 AB @BD2,@RAMSAT+1 ; X=X+2 MVBOX3 COC @KEY3,R1 ; Up ? JNE MVBOX4 SB @BD2,@RAMSAT ; Y=Y-2 MVBOX4 COC @KEY4,R1 ; Down JNE MVBOX5 AB @BD2,@RAMSAT ; Y=Y+2 MVBOX5 BL @CPYM2V ; Dump copy of SAT to VDP SAT DATA >0300,RAMSAT,6 ; ... R11 is overwritten B *R0 ; ... so return using copy in R0 KEY1 DATA K1LF ; Left KEY2 DATA K1RG ; Right KEY3 DATA K1UP ; Up KEY4 DATA K1DN ; Down *************************************************************** * Our constants ********@*****@*********************@************************** MYTAB DATA RAMTAB ; Location of timer table in scratchpad memory SPRITE DATA >2020,>000F ; Row >20, col >20, pattern >00, color white DATA >0D00 ; No more sprites PAT1 DATA >FF81,>8181,>8181,>81FF MSG1 BYTE 52 TEXT 'Use joystick 1 or keys E,S,D,X for moving sprite' END
1) Copy 6 bytes from ROM into scratchpad memory location >8340.
This is our work copy of the SAT (Sprite Attribute Table), the table that keeps the sprite information.
2) Dump the sprite pattern from ROM to VDP RAM >1000. That is where the Sprite Pattern Table is located.
3) Put the message 'Use joystick 1 or keys ...' on screen
4) Setup a timer table in scratchpad memory at @>8346 and allocate timer slot >00 by using the MKSLOT routine.
The routine MVBOX should be called by the timer manager on every second tick. (That is 30 times per second on NTSC, 25 times per second on PAL).
5) Branch to TMGR, the thread scheduler.
1) Call the "kernel" thread that is responsible for keyboard scanning, running sound player, etc.
FYI: All options of the kernel thread can be controlled by various bits in the CONFIG register (R12).
2) Call our thread (MVBOX) in slot 0 on every second tick.
* It first checks if any key was pressed at all. It does that by checking a certain bit in the CONFIG register (R12).
If no key was pressed, then it just dumps the work copy of the SAT table to the real SAT table in VDP memory and exits.
* If a key was pressed, it verifies if it's one of the known keys (ESDX),
if it matches, it updates the Y & X positions in the SAT work copy and then dumps the work copy into the real SAT table in VDP memory.
Posted Fri Nov 12, 2010 4:32 PM
Posted Fri Nov 12, 2010 4:37 PM
Posted Sat Nov 13, 2010 12:01 AM
Opry99er, on Fri Nov 12, 2010 4:37 PM, said:
SPFONT EQU FNOPT7 ; Font to load. See LDFONT for details.See post #56 (at the bottom).
Opry99er, on Fri Nov 12, 2010 4:37 PM, said:
COPY "D:\Projekte\spectra2\tms9900\runlib.a99"Yep.
Posted Sat Nov 13, 2010 1:26 AM
Posted Sat Nov 13, 2010 3:46 AM
Opry99er, on Sat Nov 13, 2010 1:26 AM, said:
Edited by retroclouds, Sat Nov 13, 2010 3:50 AM.
Posted Sat Nov 13, 2010 8:43 AM
Posted Sat Nov 13, 2010 1:12 PM
Opry99er, on Sat Nov 13, 2010 1:26 AM, said:
Edited by sometimes99er, Sat Nov 13, 2010 1:37 PM.
Posted Sat Nov 13, 2010 1:29 PM
retroclouds, on Sat Nov 13, 2010 3:46 AM, said:
Posted Sat Nov 13, 2010 1:44 PM
sometimes99er, on Sat Nov 13, 2010 1:29 PM, said:
retroclouds, on Sat Nov 13, 2010 3:46 AM, said:
Posted Sat Nov 13, 2010 2:27 PM
Posted Sat Nov 13, 2010 2:52 PM
retroclouds, on Sat Nov 13, 2010 1:44 PM, said:
Edited by sometimes99er, Sat Nov 13, 2010 3:36 PM.
Posted Sat Nov 13, 2010 2:55 PM
Opry99er, on Sat Nov 13, 2010 2:27 PM, said:
0 members, 0 guests, 0 anonymous users