chjmartin2 Posted December 22, 2010 Share Posted December 22, 2010 I have put together a flicker mode demonstration. It is nothing fancy yet, but bear with me because I just learned assembler 2 days ago. What this program does is rapidly switch between two colors while waiting for a vertical refresh flag, meaning, it doesn't start drawing until it knows the last screen was done drawing. My assumption is that there is enough clock cycles to complete the task in a single frame - but I could be wrong. This is untested on an actual aquarius, but works well on the emulator. (Remember to have your timing set to NTSC.) Check it out and let me know what you think. Basic Program 5 x=0:i=0:n=0 10 DATA 33,212,52,219,253,203,71,32,250,205,27,125,33,212,52,219,253 20 DATA 203,71,32,250,205,54,125,195,0,125,14,255,6,0,112,35,13,121,230 30 DATA 15,254,15,204,48,125,121,177,32,241,112,201,17,24,0,25,4,201 40 DATA 14,255,6,0,112,35,4,13,121,230,15,254,15,204,76,125,121,177,32 41 DATA 240,112,201,17,24,0,25,201 44 data -1 45 n=32000: 50 POKE 14341,INT(N/256):POKE 14340,N-256*PEEK(14341) 60 READ I:IF I=-1 GOTO 75 70 POKE N,I:N=N+1:GOTO 60 75 print chr$(11); 80 print " 64 Flicker Color" 85 print " 256 Block Matrix Demonstration" 90 t=0 100 poke 13484+t,t:poke 13484+t+(17*40),t 110 poke 13484+((t+1)*40)-1,t:poke 13484+17+((t+1)*40)-1,t 120 t=t+1:if t<>16 then goto 100 130 x=usr(0) 140 goto 130 For the geeks, here is the ASM code: ; File: FLICK.ASM; Displays a 64 Color Aquarius "Mode" ; ; Use tasm (supplied with VirtualAquarius) to compile: ; tasm -80 -b test.asm ; .org 32000 ; Start Program at Memloc 32000 main: ld hl, 13524 ; Set Memory Location to Color Video delaya: in a, (253) ; Read VSYNC Signal Flag bit 0,a ; Test bit 1 of VSYNC signal jr nz, delaya ; Loop and wait for the sync call hblock ; Draw the horizontal block ld hl, 13524 ; Reset the Memloc delayb: in a, (253) ; Read VSYNC Signal Flag bit 0,a ; Test bit 1 of VSYNC signal jr nz, delayb ; Loop and wait for the sync call vblock ; Draw the vertical block jp main hblock: ld c, 255 ; 16 Blocks x 16 Lines, c counter ld b, 0 ; Start the Block at color 0 hloop: ld (hl), b ; Set the color inc hl ; Move to next location dec c ; drop the counter ld a, c ; check out the counter AND 15 ; Strip off first nibble cp 15 ; is the second nibble 15? call z, nxtline ; go to the next line ld a, c ; put the counter back in accumulator or c ; Are we at zero? jr nz, hloop ; if counter is nz repeat loop ld (hl),b ret ; if counter is z return nxtline:ld de, 24 ; Lines are 40 bytes long, at end of line, 40-16 add hl, de ; Add 40 to the memloc inc b ret vblock: ld c, 255 ; 16 Blocks x 16 Lines, c counter ld b, 0 ; Start the Block at color 0 vloop: ld (hl), b ; Set the color inc hl ; Move to next location inc b dec c ; drop the counter ld a, c ; check out the counter AND 15 ; Strip off first nibble cp 15 ; is the second nibble 15? call z, ntline ; go to the next line ld a, c ; put the counter back in accumulator or c ; Are we at zero? jr nz, vloop ; if counter is nz repeat loop ld (hl),b ret ; if counter is z return ntline: ld de, 24 ; Lines are 40 bytes long, at end of line, 40-16 add hl, de ; Add 40 to the memloc ret .END flick.zip Quote Link to comment Share on other sites More sharing options...
mvdsteenoven Posted December 22, 2010 Share Posted December 22, 2010 Check it out and let me know what you think. Very funny, but I am not sure if I saw all 64 colors. Good program! Regs, Martin Quote Link to comment Share on other sites More sharing options...
MattelAquarius Posted December 23, 2010 Share Posted December 23, 2010 Since my pc has a lot of processes running in the background (video editing, DVR, etc), I had to turn up the Aquarius processing speed to get the effect. I could see a nice color gradient table forming. Nice! I look forward to seeing this developed further. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.