Home | Reviews | GUIpedia | Forum | Fun500


BrandonViper Screenshots
I've been working on and off lately, I think it's far enough that I can show off a couple screenshots. BTW: My checkered background draws very slowly, if someone knows of a fast way to do it, I'm listening.
2010-09-021:15 PM

HorvatMRe:Viper Screenshots
Well, it would help if you posted your code so we can see what approach you took.
2010-09-037:15 AM

BrandonRe:Viper Screenshots
I am still in early BETA development, there is no way I'm going to release source code, I haven't even released compiled code.
2010-09-038:29 AM

HorvatMRe:Viper Screenshots
I meant _the background routine_.
2010-09-0310:29 AM

BrandonRe:Viper Screenshots
Oh sorry, well It's just 2 for..next loops with a variable that's toggled between 1 and 0 to decide if the row is offset by own or not then the pixels are drawn one at a time with a FOr with STEP 2, I could get the code, but I'd have to boot my dev laptop, and it's pretty simple.
2010-09-0311:42 AM

JasonRe:Viper Screenshots
why not just use the line command? it has a bitscan parameter right?
2010-09-0311:49 AM

BrandonRe:Viper Screenshots
That's what I ended up doing with Horvats help.
2010-09-031:43 PM

DickRe:Viper Screenshots
SCREEN 12
FOR i = 0 TO 479 LINE (i AND 1, i)-(639, i), 15, , &H5555 NEXT
You can use assembly too

2010-09-134:39 PM

HorvatMRe:Viper Screenshots
Mine is a bit faster: Pattern% = &HAAAA FOR Y% = 0 TO 479 LINE (0, Y%)-(639, Y%), , , Pattern% Pattern% = NOT Pattern% NEXT Y% (Of course any good programmer would use CONSTs rather than hardcoded values.) I also tried assembly, but it doesn't work for whatever reason - it freezes (I never did graphics in assembly before - in fact, I've never used assembly mixed with QB): push bp mov bp, sp mov bx, 40960 ; Video data for mode 11h starts at that segment mov ds, bx ; Copy because you can't MOV immediate into DS mov al, 170 ; The pattern (10101010 binary, AA hexadecimal) xor bx, bx ; Starting offset = 0 Loop: cmp bx, 38400 ; Finished? (38400 = 480 * 80) je Finish ; If yes, jump, otherwise... mov [bx], al ; Paint the pattern at that pixel not al ; Invert it to produce a checkerboard inc bx ; Set next location jmp Loop ; Go to next pixel Finish: pop bp retf
2010-09-149:57 AM

DickRe:Viper Screenshots
You need to push ds too.  And when fixed, it don't make checkered background but horizontal lines. here is my asm version     push bp
mov bp,sp
push es
mov ax,0a000h
mov es,ax
xor di,di
mov ax,05555h
mov dx,480
label:
mov cx,40
rep stosw
not ax
dec dx
jnz label
pop es
pop bp
retf


and qbasic:
DIM a(7) AS LONG
a(0) = &H6E58955
a(1) = &H8EA000B8
a(2) = &HB8FF31C0
a(3) = &HE0BA5555
a(4) = &H28B901
a(5) = &HD0F7ABF3
a(6) = &H7F6754A
a(7) = &HCB5D
SCREEN 11
DEF SEG = VARSEG(a(0))
CALL absolute(VARPTR(a(0)))
SLEEP


Different design
SCREEN 12

DIM i AS INTEGER
FOR i = 0 TO 480 STEP 4
LINE (0, i)-(639, i), , , &H8888
LINE (0, i + 1)-(639, i + 1), , , &H4444
LINE (0, i + 2)-(639, i + 2), , , &H1111
LINE (0, i + 3)-(639, i + 3), , , &H2222
NEXT
SLEEP

2010-09-143:05 PM

Blog


2021 Brandon Cornell