Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
alternative pset
#1
screen 18,16

sub basic(byval memory as integer ptr,byval x as integer,byval y as integer,byval c as integer)
dim index as integer
index = y shl 9 + y shl 7 +x 'y * 640 + x
memory[index]=c
end sub

dim as integer ptr videomemory

screenlock:videomemory=screenptr

basic videomemory,10,10,rgb(25,0,25)
basic videomemory,638,478,rgb(25,0,25)

Why do i get a error when i wanna draw a pixel further down on the screen?
This works in 32 bit mode, but not in 16 bit?!
ttp://hem.passagen.se/qb.basta
Reply
#2
Because you're memory type is the wrong size.

In 16-bit mode, then memory is SHORT not INTEGER.
Life is like a box of chocolates', hrm, WTF, no it isn't, more like, 'life is like a steaming pile of horse crap.'
Reply
#3
tried with that, but it won't work..
ttp://hem.passagen.se/qb.basta
Reply
#4
Code:
option explicit
sub set16(byval memory as ushort ptr,byval x as integer,byval y as integer,byval c as ushort)
  dim index as integer
  index = y shl 9
  index+= y shl 7
  index+= x
  memory[index]=c
end sub

sub set32(byval memory as integer ptr,byval x as integer,byval y as integer,byval c as integer)
  dim index as integer
  index = y shl 9
  index+= y shl 7
  index+= x
  memory[index]=c
end sub

#define bpp 16 ' or 32

#if bpp = 16
  dim as ushort  ptr videomemory
#else
  dim as integer ptr videomemory
#endif

screen 18,bpp

screenlock
videomemory=screenptr

#if (bpp = 32)
  set32 videomemory, 10, 10, &HFFFFFF
  set32 videomemory,320,240, &HFFFFFF
  set32 videomemory,629,468, &HFFFFFF
#else
  set16 videomemory, 10, 10,&HFFFF
  set16 videomemory,320,240,&HFFFF
  set16 videomemory,629,469,&HFFFF
#endif

screenunlock

sleep
sorry about my english
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)