flat assembler
Message board for the users of flat assembler.
Index
> DOS > Capture fullscreen dos screen under win xp? |
Author |
|
sinsi 14 Jun 2008, 03:38
Watch out with mixing 8/16 bits e.g.
Code: mov al,[y1] ;converting the beginning y and the x into a single number.....y*320+x mov bx,ax ;^^^ if AH is FF for example your calculations get screwed up. Better to define x,y1,y2 as words. This is just personal, but Code: add di,319 ;or even "320-1" makes more sense than Code: add di,13fh ;go to next line Code: key: in ax,60h ;get current key dec ax ;check for esc jnz key ;if no, go back to key checker....else, continue Reading ports can be a problem (you're trying to read port 61h as well into AH) - just use Code: key: sub ah,ah ;BIOS wait for keypress int 16h cmp ah,1 ;esc key? jnz key One more, "loop" uses CX, not just CL. |
|||
14 Jun 2008, 03:38 |
|
windwakr 14 Jun 2008, 03:58
Thanks for the info. I'll try to remember that stuff in the future.
|
|||
14 Jun 2008, 03:58 |
|
rugxulo 14 Jun 2008, 03:59
windwakr wrote: Does anyone know how to capture the screen from mode 13h? Snarf, maybe? (w/ .ASM src) |
|||
14 Jun 2008, 03:59 |
|
rCX 14 Jun 2008, 06:22
You could also use DOSBox and press print screen for the window or when it is in full screen mode (Note: In full screen mode, rows of pixels are added to top and bottom. You might want to plot a pixel for reference).
|
||||||||||
14 Jun 2008, 06:22 |
|
DOS386 14 Jun 2008, 11:26
windwakr wrote:
> Capture fullscreen dos screen Screenshooting under DOS is exhaustively documented here: WOW > doesnt seem to work right under xp Oops ... posting in DOS subforum and not using DOS ? no DOSwakr ( 1'166 Byte's PNG ) Shot it for you in DOS with SNARF ... oops the wrong one Your code has 2 criminal BUG's (as already pointed) : Code: mov cl,bl ;get loop ready iloop: stosb ;plot pixel add di,13fh ;go to next line loop iloop ;loop until line is finished Regrettably loop decrements CX in 16-bit code and I don't see any initialization of CH Code: in ax,60h ;get current key dec ax ;check for esc jnz key ;if no, go back to key checker.... You should in'ate AL not AX ... as-is your code triggers a hard freezer Last edited by DOS386 on 06 Feb 2010, 07:37; edited 1 time in total |
|||
14 Jun 2008, 11:26 |
|
windwakr 14 Jun 2008, 12:33
Thanks for the help and for showing me errors in my code.
|
|||
14 Jun 2008, 12:33 |
|
rain_storm 15 Jun 2008, 04:51
Here is a routine I made for doing a screen capture. It is optimised for size (but not to extreme size) it was never meant for anything but doing a screen capture on exit from a 256 byte intro. its not very well commented but if you need something explained you can ask. This routine takes many shortcuts. not just by storing the header inside the routine it also outputs the file upside down for example. its not clean but you can learn from it
what it does is simple the header is stored in the routine This is written to file as is. next it starts reading red, green, blue values from pallet registers (starting at pallet index 0) this is stored to memory (+1 byte zero padding) This is written to file when all colours are stored. then it simply writes the screen memory to file as is (this is cheating cos the output is upside down but I can live with that) and that is all there is too it. those steps again write header to file send 0 -> port 03C7h read r,g,b from port 003C9h (all 256 colours) write colours to file write screen to file like this ds = A000h cx = FA00h dx = 0000h bx = file handle ah = 40h int 21h
|
|||||||||||
15 Jun 2008, 04:51 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.