Page 1 of 2

Small X-mas demo

Posted: Mon Dec 24, 2007 6:11 pm
by TmEE co.(TM)

Posted: Mon Dec 24, 2007 9:01 pm
by Jorge Nuno
site is down...

ED: ok got it

Posted: Mon Dec 24, 2007 9:47 pm
by Chilly Willy
No, he just typed in the url wrong. It's
http://www.hot.ee/tmeeco/DWNLOADS/XMASDEMO.RAR

Posted: Mon Dec 24, 2007 9:48 pm
by TmEE co.(TM)
I just noticed... fixed it...

Posted: Tue Dec 25, 2007 7:41 am
by HardWareMan
TmEE co.(TM) wrote:I just noticed... fixed it...
Check this out. You can use my scroll. :) Here is source:

Code: Select all

ScrollState     equ    $FFE00C         *Free scroll flag
ScrollPos       equ    $FFE00E         *Scroll current position
ScrollString    equ    $FFE012         *Pointer to start scroll string
Screen          equ    $FFF000         *ASCII screen

*Insert this in VBlank Routine
	move.w      ScrollState,d0  *
	addq.w      #1,d0           *
           and.w       #$0003,d0       *
           move.w      d0,ScrollState  *
           bne         SkipScrl        *
	move.l	#$03200002,$C00004	 *Reading form VRAM at 0x8320
           move.w      $c00000,d0      *[d0] - scrolling
           subq.b      #1,d0           *
           and.b       #$07,d0         *
	move.l	#$43200002,$C00004	 *Write to VRAM at 0x8320
           move.w      d0,$c00000      *[d0] - scrolling
           cmp.b       #07,d0          *
           bne         SkipScrl        *
           move.w      $FFFC80,$FFFCFE *
           move.l      #$FFFC7E,d0     *
           move.l      d0,a0           *
           addq.l      #2,d0           *
           move.l      d0,a1           *
           move.w      #40,d0          *
ScrlLn:    move.w      (a1)+,(a0)+     *
           dbra        d0,ScrlLn       *
*Printing #00-terminated string.
ScrlPrnt:  move.l      ScrollPos,d0    *
           move.l      d0,a0           *
           move.b      (a0)+,d0        *
           cmp.b       #0,d0           *
           beq         ScrlEnS         *
           and.w       #$00FF,d0       *
           or.w        #$8000,d0       *
           move.w      d0,$FFFCD0      *
           move.l      a0,d0           *
           move.l      d0,ScrollPos    *
           bra         SkipScrl        *
ScrlEnS:   move.w      #$8020,$FFFCD0  *
           move.l      #ScrollString,d0 *
           move.l      d0,ScrollPos    *
SkipScrl:
*Update ASCII screen every frame with DMA
*But it can be shrinking to scroll only. 32 or 40 words + 1.
        move.w	#$9300,$C00004	*Size low byte => Reg#19
	move.w	#$9407,$C00004		*Size high byte => Reg#20
	move.w	#$9500,$C00004		*String low byte => Reg#21
	move.w	#$96F8,$C00004		*String middle byte => Reg#22
	move.w	#$977F,$C00004		*String high byte => Reg#23
	move.l	#$40000083,$C00004	 *VRAM write with DMA at $C000
*end
*Call this to scroll init (copying string to buffer) (a0)
ScrlInit:  dc.w        $48E7,$FFFE     *MOVEM.L	 D0-D7/A0-A6,-(A7)
           or.w        #$0700,sr       *IRQ off
           move.l      #$FFFC80,d0     *
           move.l      d0,a1           *
           move.l      #41,d0          *
ScrlClr:   move.w      #$8020,(a1)+    *
           dbra        d0,ScrlClr      *
           move.l      #ScrollString,d0 *
           move.l      d0,ScrollPos    *
           move.l      d0,a1           *
ScrlInLp:  move.b      (a0),d0         *
           move.b      (a0)+,(a1)+     *
           cmp.b       #0,d0           *
           bne         ScrlInLp        *
	and.w       #$F8FF,sr		*IRQ on
           dc.w        $4CDF,$7FFF     *MOVEM.L	 (A7)+,D0-D7/A0-A6
           rts                         *
BTW. System independ timer program.

Code: Select all

*VBlank
        subq.w   #1,TimeStamp           *
        cmp.w    #0,TimeStamp           *
        bne      TimeEx                 *
        move.w   #60,d1                 *
        move.w   $A10000,d0             *
        and.b    #$40,d0                *
        cmp.b    #$00,d0                *
        beq      SetPre                 *
        move.w   #50,d1                 *
SetPre: move.w   d1,TimeStamp           *
        addq.b  #1,TimeSec+1            *
        cmp.b   #$3A,TimeSec+1          *
        bne     TimeEx                  *
        move.b  #$30,TimeSec+1          *
        addq.b  #1,TimeSec              *
        cmp.b   #$36,TimeSec            *
        bne     TimeEx                  *
        move.b  #$30,TimeSec            *
        addq.b  #1,TimeMin+1            *
        cmp.b   #$3A,TimeMin+1          *
        bne     TimeEx                  *
        move.b  #$30,TimeMin+1          *
        addq.b  #1,TimeMin              *
        cmp.b   #$36,TimeMin            *
        bne     TimeEx                  *
        move.b  #$30,TimeMin            *
TimeEx: 
TimeStamp - frame counter
TimeSec - 2 bytes time seconds in ASCII
TimeMin - 2 bytes time minutes in ASCII

Posted: Tue Dec 25, 2007 12:31 pm
by TmEE co.(TM)
Hehe, nice !!! Thanks for the code, but I'll end up using my own anyway (I don't really like to use other's code in my stuff).

Merry x-mas everyone !!!

Posted: Tue Dec 25, 2007 1:13 pm
by HardWareMan
TmEE co.(TM) wrote:Hehe, nice !!! Thanks for the code, but I'll end up using my own anyway (I don't really like to use other's code in my stuff).
I don't tell you "copy that". Just a sample. Use VDP scroll control and name table.
TmEE co.(TM) wrote:Merry x-mas everyone !!!
You too.

Posted: Tue Dec 25, 2007 5:48 pm
by TmEE co.(TM)
The TFM player doesn't work correctly on my MD2 (or MD1s). If you try to play a file, it halts (scroller still works)...

I got a 2GB Kingston microSD card with its USB reader for x-mas, what did you get ?

Posted: Tue Dec 25, 2007 6:17 pm
by Jorge Nuno
I just offered myself a LFXP6C-5QN208C (142 ios flash FPGA), a PIC18F2520 and some low power SRAMs for mega-driving purposes... :lol:

Posted: Tue Dec 25, 2007 6:58 pm
by Christuserloeser
Thanks for this demo. I'll download it when I'm home :D

Posted: Tue Dec 25, 2007 7:03 pm
by TmEE co.(TM)
No problem... it was a last minute thing so there's not much in it.

Posted: Wed Dec 26, 2007 4:38 am
by HardWareMan
TmEE co.(TM) wrote:The TFM player doesn't work correctly on my MD2 (or MD1s). If you try to play a file, it halts (scroller still works)...
My PD-ROMs are always pass trough test on real hardware. So, I guess it's your fault.
TmEE co.(TM) wrote:I got a 2GB Kingston microSD card with its USB reader for x-mas, what did you get ?
I got a 4Gb MMC card, MMC/SD connector, 4MB flash and other parts for my new project for MD. ;) So, I hope it will be finished very soon.

Posted: Wed Dec 26, 2007 5:44 pm
by TmEE co.(TM)
The only problem I can think if is my flashcart which is just 2x 16mbit ROMs and a custom EEPROM mapper, no SRAM of any kind...

Posted: Thu Dec 27, 2007 9:01 am
by HardWareMan
TmEE co.(TM) wrote:The only problem I can think if is my flashcart which is just 2x 16mbit ROMs and a custom EEPROM mapper, no SRAM of any kind...
It seems that I have to apologize to you. Indeed, at one NTSC console hangs happening. It turned out wrong expectation of Z80 bus... :shock: Bug fixed, take here: http://tv-games.ru/modules.php?name=Fil ... it&lid=840

Posted: Thu Dec 27, 2007 12:16 pm
by Jorge Nuno
Nice Xmas demo there, TmEE you should have applied some mask or modulo function to the address register, to display the text from the beginning instead of ascii-printable opcodes/data/$hit (like a circular buffer)