Posted Fri Sep 10, 2010 2:03 PM
Posted Sun Sep 19, 2010 3:11 AM

A) Register workspace
That's obvious right? On the TMS9900 CPU we need a workspace in memory to hold the 16 registers.
B) Address of timer table
We can now have multiple timer tables and the timer table can also be relocated. This offers more flexibility compared to the original
SPECTRA implementation where we only had a fixed address.
C) Address of sound table (tune)
The built-in sound player will be compatible with the ISR sound format. The tune can either be in VDP memory or ROM/RAM.
This is controlled by one of the bits in (D).
D) Cursor YX position
This is new in spectra2. We'll have some functions you can use to put tiles & text at specific coordinates
without you having to calculate each individual position.
E) Virtual game keyboard flags or keycodes
Already had the concept of a virtual game keyboard in SPECTRA1.
The idea is that we have a keyboard (including mapping to joysticks) and each bit represents a game key.
Most likely there will be an additional keyboard scan routine that can hold the typed key and a status flag.
F) Loop code + return from stack
This is new in SPECTRA2. It contains some machine code that is copied from ROM on library startup.
We can easily modify the machine code during runtime by overwriting some of the opcodes.
registers Purpose ========= ============================================================ R0-R3 A General purpose registers R4-R7 B Temporary registers R8 C Return stack and data stack pointer R9 D Address of return routine (M3POPR) R10 E Highest slot in use + Timer counter R11 F Subroutine return address R12 G SPECTRA2 configuration register R13 H Copy of VDP status byte and internal counter for sound player R14 I Copy of VDP write-only register #0 and #1 R15 J VDP write address =============================================================================
Edited by retroclouds, Sun Sep 19, 2010 3:13 AM.
Posted Sun Sep 19, 2010 8:49 AM
bit 15 Sound player tune source 1=ROM/RAM 0=VDP MEMORY bit 14 <<free>> bit 13 <<free>> bit 12 Keyboard mode 1=real 0=virtual bit 11 <<free> bit 10 Timer has hyperthread 1=yes 0=no bit 9 <<free> bit 8 <<free> bit 7 <<free> bit 6 <<free> bit 5 <<free> bit 4 <<free> bit 3 V2.2 console 1=yes 0=no bit 2 Speech synth present 1=yes 0=no bit 1 VDP9918 PAL version 1=yes(50) 0=no(60) bit 0 32K memory expansion 1=yes 0=no
Posted Fri Sep 24, 2010 5:07 PM
Posted Sat Sep 25, 2010 2:29 AM
Opry99er, on Fri Sep 24, 2010 5:07 PM, said:
Posted Sun Sep 26, 2010 10:47 AM
bit 15 Sound player: Tune source 1=ROM/RAM 0=VDP MEMORY bit 14 Sound player: Loop tune 1=yes 0=no bit 13 Sound player: on 1=yes 0=no (or pause) bit 12 ASM: Motion Table source 1=ROM/RAM 0=VDP MEMORY bit 11 ASM: Automatic Sprite Motion on 1=yes 0=no bit 10 Timer has fast thread 1=yes 0=no bit 9 <<free> bit 8 <<free> bit 7 <<free> bit 6 <<free> bit 5 <<free> bit 4 <<free> bit 3 V2.2 console 1=yes 0=no bit 2 Speech synth present 1=yes 0=no bit 1 VDP9918 PAL version 1=yes(50) 0=no(60) bit 0 32K memory expansion 1=yes 0=no
Edited by retroclouds, Sun Sep 26, 2010 10:48 AM.
Posted Tue Sep 28, 2010 12:03 AM
Posted Tue Sep 28, 2010 4:48 AM
Opry99er, on Tue Sep 28, 2010 12:03 AM, said:
Posted Tue Sep 28, 2010 6:24 AM
Edited by sometimes99er, Tue Sep 28, 2010 6:36 AM.
Posted Tue Sep 28, 2010 1:07 PM
Posted Tue Sep 28, 2010 1:24 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 KERNEL HW BYTE 12 TEXT 'HELLO WORLD!' *-------------------------------------------------------------- * Include required files *-------------------------------------------------------------- COPY "F:\Projekte\spectra2\tms9900\runlib.a99" *************************************************************** * Main ********@*****@*********************@************************** MAIN BL @FILV DATA >0380,>F0,16 ; Set color table BL @LDFONT DATA >900 ; Load title screen font LI R0,>8370 MOV R0,@WTIMER ; Our timer table BL @MKSLOT DATA >000F,BLINK,0 ; thread in slot 0 must run every 15 ticks MOVB @BDIG1,@>8369 B @TMGR ; Run thread scheduler *************************************************************** * Thread ********@*****@*********************@************************** BLINK MOV R11,R0 ; Save NEG @>8368 JLT BLIN2 BLIN1 BL @PUTYX DATA >050A,HW ; Show "Hello World!" message JMP BLIN3 BLIN2 BL @HCHAR BYTE >05,>0A,32,12 ; white space x BLIN3 MOV R0,R11 ; Restore B *R11 END
hw.zip 2.08K
8 downloadsPosted Tue Sep 28, 2010 1:49 PM
Posted Wed Sep 29, 2010 11:18 AM
sometimes99er, on Tue Sep 28, 2010 1:49 PM, said:
<?xml version="1.0" encoding="utf-8"?> <romset version="1.0"> <resources> <rom id="romimage1" file="hw.bin"/> </resources> <configuration> <pcb type="standard"> <socket id="rom_socket" uses="romimage1"/> </pcb> </configuration> </romset>
Edited by retroclouds, Wed Sep 29, 2010 11:22 AM.
Posted Wed Sep 29, 2010 11:19 AM
Posted Wed Sep 29, 2010 11:25 AM
retroclouds, on Wed Sep 29, 2010 11:18 AM, said:
Posted Wed Oct 6, 2010 1:20 PM

A) Register workspace
That's obvious right? On the TMS9900 CPU we need a workspace in memory to hold the 16 registers.
B) Loop code
This is new in SPECTRA2. It contains some machine code that is copied from ROM on library startup.
We can easily modify the machine code during runtime by overwriting some of the opcodes.
I dropped the part that is responsible for returning from the stack. This saves 4 bytes.
C) Address of timer table
We can now have multiple timer tables and the timer table can also be relocated. This offers more flexibility compared to the original
SPECTRA implementation where we only had a fixed address.
D) PNT base address **new**
This is new in spectra2. It contains the base address of the pattern name table.
We can set the value here and then use it in several derived calculations.
E) Cursor YX position
This is new in spectra2. We'll have some functions you can use to put tiles & text at specific coordinates
without you having to calculate each individual position.
F) Virtual game keyboard flags or keycodes
Already had the concept of a virtual game keyboard in SPECTRA1.
The idea is that we have a keyboard (including mapping to joysticks) and each bit represents a game key.
Most likely there will be an additional keyboard scan routine that can hold the typed key and a status flag.
G) Sound player - Address of sound table (tune)
The built-in sound player will be compatible with the ISR sound format. The tune can either be in VDP memory or ROM/RAM.
This is controlled by one of the bits in (D).
H) Sound player - temporary use **new**
2 bytes required while running the sound player. By using these bytes I enhance the functionality of the sound player.
It's now possible to loop a tune or chain multiple tunes.
registers Purpose ========= ============================================================ R0-R3 A General purpose registers R4-R8 B Temporary registers R9 C Stack pointer R10 E Highest slot in use + Timer counter R11 F Subroutine return address R12 G SPECTRA2 configuration register R13 H Copy of VDP status byte and internal counter for sound player R14 I Copy of VDP write-only register #0 and #1 R15 J VDP write address =============================================================================
Posted Wed Oct 6, 2010 1:58 PM
Edited by retroclouds, Wed Oct 6, 2010 2:20 PM.
Posted Thu Oct 7, 2010 1:52 AM
Posted Fri Oct 8, 2010 11:46 AM
retroclouds, on Thu Oct 7, 2010 1:52 AM, said:
EditX CmdX BSS 2 ; reserve two bytes for EditorX and Command Line X coordinatesSimple as that. Obviously, this takes no extra code space, and you get the added benefit of being able to refer to a memory location in it's proper context at the appropriate points in your code.
Posted Sat Oct 9, 2010 1:50 AM
retroclouds, on Wed Aug 18, 2010 2:06 AM, said:
sometimes99er, on Tue Aug 17, 2010 2:43 PM, said:
Posted Sun Oct 10, 2010 11:47 AM
Posted Sun Oct 17, 2010 1:10 PM
Posted Mon Oct 18, 2010 7:26 AM
Posted Mon Oct 18, 2010 11:42 PM
Willsy, on Mon Oct 18, 2010 7:26 AM, said:
Posted Sat Oct 23, 2010 12:36 PM
hw.zip 5.94K
14 downloads
0 members, 0 guests, 0 anonymous users