Home | Reviews | GUIpedia | Forum | Fun500
HorvatM | Re:Viper ScreenshotsWell, it would help if you posted your code so we can see what approach you took. | 2010-09-03 | 7:15 AM |
Brandon | Re:Viper ScreenshotsI 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-03 | 8:29 AM |
HorvatM | Re:Viper ScreenshotsI meant _the background routine_. | 2010-09-03 | 10:29 AM |
Brandon | Re:Viper ScreenshotsOh 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-03 | 11:42 AM |
Jason | Re:Viper Screenshotswhy not just use the line command? it has a bitscan parameter right? | 2010-09-03 | 11:49 AM |
Brandon | Re:Viper ScreenshotsThat's what I ended up doing with Horvats help. | 2010-09-03 | 1:43 PM |
Dick | Re:Viper ScreenshotsSCREEN 12
FOR i = 0 TO 479 LINE (i AND 1, i)-(639, i), 15, , &H5555 NEXT You can use assembly too | 2010-09-13 | 4:39 PM |
HorvatM | Re:Viper ScreenshotsMine 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-14 | 9:57 AM |
Dick | Re:Viper ScreenshotsYou 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-14 | 3:05 PM |
2021 Brandon Cornell