Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NEED HELP WRITING A 32-BIT TRUE COLOR PIXEL SUB PROGRAM
#1
Code:
'SWITCH TO 800X600X32BPP VIDEO MODE
DETECTVIDEO 800, 600, 32
SETVIDEO
'SETUP COLOR
COLOUR = VAL("&H" + HEX$(BLUE%) + "&H" + HEX$(ALPHA%) + "&H" + HEX$(RED%) + "&H" + HEX$(GREEN%))
' DRAW 32-BIT PIXEL TO SCREEN
MEM16 &HA000, 0, COLOUR, 0

'MOV AX, SEG&
'MOV ES, AX
'MOV WORD PTR [OFF&], DAT&
'RETF RET&

SUB MEM16 (SEG&, OFF&, DAT&, RET&)
DIM ASM AS STRING
ASM = ""
ASM = ASM + CHR$(&HB8) + MKI$(SEG&)
ASM = ASM + CHR$(&H8E) + CHR$(&HC0)
IF LEN(MKI$(OFF&)) < 3 THEN
  ASM = ASM + CHR$(&HC7) + CHR$(&H06) + MKI$(OFF&) + MKI$(DAT&)
ELSE
  ASM = ASM + CHR$(&HC7) + CHR$(&H06) + MKI$(OFF&) + MKI$(DAT&)
  ASM = ASM + CHR$(&HC7) + CHR$(&H06) + MKI$(OFF&+3) + MKI$(DAT&)
END IF
ASM = ASM + CHR$(&HCA) + MKI$(RET&)
DEF SEG = VARSEG(ASM)
  CAL ABSOLUTE(SADD(ASM))
DEF SEG
END SUB
Reply
#2
Erm... what? What language is that in? What's the program supposed to do? And, most of all, what do you want out of us?
.14159265358979323846264338327950288419716939937510582709445
Glarplesnarkleflibbertygibbertygarbethparkentalelelangathaffendoinkadonkeydingdonkaspamahedron.
Reply
#3
1) The program is written in QBASIC 1.1 for dos.
2) I am using a VESA Lib I programmed about 2 months ago.
3) The program is supposed to plot a 32bpp pixel in the upper left hand counter.
Reply
#4
1.-The program may be in QB but you are issuing machine-code instructions, are you asking us to read machine-code? Could you put the assembler instructions as comments in each line for everyone to read?

2.- VESA modes are banked, you can't use a simple memcopy to access the whole screen. There is some bank switching code missing...

3.- You call some DETECTVIDEO and SETVIDEO of your own, you don't post them. Perhaps the problem is there?

4.- What's the problem?


PS: If you need absolutely to use high resolution switch to FB, it will spare you a lot of headaches....
Antoni
Reply
#5
Code:
COLOUR = VAL("&H" + HEX$(BLUE%) + "&H" + HEX$(ALPHA%) + "&H" + HEX$(RED%) + "&H" + HEX$(GREEN%))
BARG?
Never heard of that color format..

Anyways, afaik 32bit, or even anything above 8bit, is NOT supported by the VESA standard.. some cards have it, some dont.
Also, VESA is outdated, and wont work on 99.99% of modern computers

Like Antoni said, use FB if you want highres.
Reply
#6
You're right, Z!re, VAL will stop reading after the blue value. Perhaps you found the problem, without knowing what it is Big Grin
Antoni
Reply
#7
Quote:You're right, Z!re, VAL will stop reading after the blue value. Perhaps you found the problem, without knowing what it is Big Grin
I noticed the multiple &H's too, but BARG?.. Just has me stumped Tongue
Reply
#8
@Z!re
the code works.....
Reply
#9
Quote:@Z!re
the code works.....
okay! it works. and we still don't know what the original problem is/was...
[Image: sig.php]
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Reply
#10
If you really need to program using 32 bit colour I would recommend learning FreeBasic, it has native 32bit colour.
f you play a Microsoft CD backwards you can hear demonic voices. The scary part is that if you play it forwards it installs Windows.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)