Welcome, Guest. Please login or register.

Author Topic: using those tiny little LCD screens as monitors...  (Read 4798 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: using those tiny little LCD screens as monitors...
« Reply #14 on: January 09, 2011, 01:22:16 PM »
Quote from: SamOS39;605031
@motorollin

its a long story. the board inside my A1200 used to be inside a EZ tower which i had to sell at the time..

i never fitted the scan doubler and i didnt want to attept to remove it .. i dont even know if it can be removed ..

besides i got it plugged into a VGA tube at the moment and the picture is crystal clear!


Fair enough. It certainly would look better on VGA than composite.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: using those tiny little LCD screens as monitors...
« Reply #15 on: January 09, 2011, 01:24:04 PM »
Quote from: JJ;605032
no what i meant is

FOR C = 1 TO 2
  code
NEXT

usually in basic you dont have to say next c


Oh right. Presumably if you had a for..next loop embedded within another for..next loop you would have to specify which variable you were incrementing. Or would the BASIC interpreter just assume the NEXT corresponded to the preceding IF?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline nicholas

Re: using those tiny little LCD screens as monitors...
« Reply #16 on: January 09, 2011, 01:27:59 PM »
My eyes!!!! It burns it burns!!!!

BASIC is t3h evil!!!!!
“Een rezhim-i eshghalgar-i Quds bayad az sahneh-i ruzgar mahv shaved.” - Imam Ayatollah Sayyed  Ruhollah Khomeini
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: using those tiny little LCD screens as monitors...
« Reply #17 on: January 09, 2011, 01:32:59 PM »
Quote from: nicholas;605035
My eyes!!!! It burns it burns!!!!

BASIC is t3h evil!!!!!


I love the fact that it's the language, not the song, which irritates you so much :lol:

Would The Final Countdown be more tolerable in C?

Code: [Select]

while(true)
{
   itsthefinalcountdown();
   for( int i=0; i<2; i++ )
   {
      da-na-naaaa-naaa();
      da-na-na-na-naaa();
      da-na-naaaa-naaa();
      da-na-na-na-na-na-naaaaa();
   }
   na-na-naaa();
   na-na_na-na-na-na_naaaaa();
   naaa-naaaaaaaa();
}


--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show only replies by Karlos
Re: using those tiny little LCD screens as monitors...
« Reply #18 on: January 09, 2011, 01:41:35 PM »
Is it even the same loop?

"FOR C = 1 TO 2" looks like it would iterate once, whereas "for (int i=0; i<2; i++)" would iterate twice.

Of course, if you were sticking to C89, you'd not be allowed to use the declaration as statement syntax for the counter in the loop, you'd have to put an "int i;" at the top of the containing block. So, I'm going to assume your loop is C99 or C++ :D
int p; // A
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: using those tiny little LCD screens as monitors...
« Reply #19 on: January 09, 2011, 01:48:49 PM »
Quote from: Karlos;605037
Is it even the same loop?

"FOR C = 1 TO 2" looks like it would iterate once, whereas "for (int i=0; i<2; i++)" would iterate twice.


"FOR C = 1 TO 2" iterates twice - once when the value of C is 1, and again when the value is 2.

Edit - evidence attached ;)

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline tone007

Re: using those tiny little LCD screens as monitors...
« Reply #20 on: January 09, 2011, 02:26:15 PM »
All this BASIC talk reminded me of the lame ASCII Pacman I wrote back in the 90s in QBasic.

Code: [Select]
DIM board(23, 40)
DECLARE SUB InitBoard (board())
DECLARE SUB InitDots (board())
DECLARE SUB PrintBoard (board())
DECLARE SUB MovePacman (board(), x, y, Man)
DECLARE SUB MoveGhost (board(), x, y, g, f)
DECLARE SUB SetSpeed (Clock)
DECLARE SUB FreezeGhosts (Pcount, Go, Clock)
SCREEN 13
CALL InitBoard(board())
CALL InitDots(board())
CALL PrintBoard(board())
CALL SetSpeed(Clock)
Clock = INT(Clock / 50)
Go = 1
Man = 1
x = 16: y = 20
a1 = 12: b1 = 18
a2 = 12: b2 = 19
a3 = 12: b3 = 20
a4 = 12: b4 = 21
DO
   CALL MovePacman(board(), x, y, Man)
   Count = Count + 1
   IF Go = 1 THEN
      IF Count > Clock THEN
         l = l + 1
         IF l > 5 THEN
            IF x > a1 THEN f = 2
            IF x < a1 THEN f = 1
         ELSE
            f = 1
         END IF
         CALL MoveGhost(board(), a1, b1, 1, f)
         CALL MoveGhost(board(), a2, b2, 2, f)
         CALL MoveGhost(board(), a3, b3, 3, f)
         CALL MoveGhost(board(), a4, b4, 4, f)
         Count = 0
      END IF
      IF a1 = x AND b1 = y OR a2 = x AND b2 = y OR a3 = x AND b3 = y OR a4 = x AND 4 = y THEN
         LOCATE 14, 15: PRINT &quot; GAME OVER! &quot;
         PLAY &quot;GFED&quot;
         END
      END IF
   END IF
   IF board(x, y) = 249 THEN
      score = score + 10
      board(x, y) = 0
   END IF
   IF board(x, y) = 15 THEN
      score = score + 100
      board(x, y) = 0
      Go = 0
   END IF
   IF Go = 0 THEN CALL FreezeGhosts(Pcount, Go, Clock * 25)
   LOCATE 14, 15: PRINT &quot;Score:&quot;; score
   IF score = 3230 THEN
      LOCATE 14, 15
      PLAY &quot;BCD&quot;
      PRINT &quot;Y O U  W I N&quot;
      END
   END IF
LOOP

SUB FreezeGhosts (Pcount, Go, Clock)
   Pcount = Pcount + 1
   IF Pcount = Clock THEN
      Go = 1
      Pcount = 0
   END IF
END SUB

SUB InitBoard (board())
FOR x = 1 TO 40
   board(1, x) = 219
   board(23, x) = 219
   IF x <= 23 THEN board(x, 1) = 219
   IF x <= 23 THEN board(x, 40) = 219
   IF x <= 23 THEN board(x, 2) = 219
   IF x <= 23 THEN board(x, 39) = 219
NEXT x
FOR x = 14 TO 27
   board(9, x) = 219
   board(15, x) = 219
NEXT x
FOR x = 9 TO 15
   board(x, 14) = 219
   board(x, 27) = 219
NEXT x
FOR x = 4 TO 8
   board(3, x) = 177
   board(4, x) = 177
   board(3, x + 29) = 177
   board(4, x + 29) = 177
   board(20, x) = 177
   board(21, x) = 177
   board(20, x + 29) = 177
   board(21, x + 29) = 177
NEXT x
FOR x = 13 TO 28
   board(3, x) = 177
   board(4, x) = 177
NEXT x
FOR x = 6 TO 11
   FOR y = 5 TO 8
      board(x, y) = 177
      board(x, y + 28) = 177
      board(x + 7, y) = 177
      board(x + 7, y + 28) = 177
   NEXT y
NEXT x
FOR x = 2 TO 4
   board(x, 10) = 177
   board(x, 11) = 177
   board(x, 30) = 177
   board(x, 31) = 177
NEXT x
FOR x = 10 TO 12
   board(6, x) = 177
   board(7, x) = 177
   board(6, x + 19) = 177
   board(7, x + 19) = 177
NEXT x
FOR x = 14 TO 27
   board(6, x) = 177
   board(7, x) = 177
NEXT x
FOR x = 9 TO 11
   FOR y = 9 TO 12
      board(x, y) = 177
      board(x, y + 20) = 177
      board(x + 4, y) = 177
      board(x + 4, y + 20) = 177
   NEXT y
NEXT x
FOR x = 10 TO 14
   board(17, x) = 177
   board(18, x) = 177
   board(20, x) = 177
   board(21, x) = 177
   board(17, x + 17) = 177
   board(18, x + 17) = 177
   board(20, x + 17) = 177
   board(21, x + 17) = 177
NEXT x
FOR x = 16 TO 25
   board(17, x) = 177
   board(18, x) = 177
   board(20, x) = 177
   board(21, x) = 177
NEXT x
FOR x = 6 TO 9
   board(x, 3) = 219
   board(x, 38) = 219
   board(x + 9, 3) = 219
   board(x + 9, 38) = 219
NEXT x
FOR x = 1 TO 3
   board(11, x) = 219
   board(13, x) = 219
   board(11, x + 37) = 219
   board(13, x + 37) = 219
NEXT x
FOR x = 10 TO 14 STEP 2
   FOR y = 1 TO 2
      board(x, y) = 32
      board(x, y + 38) = 32
   NEXT y
NEXT x
FOR x = 18 TO 23
   board(9, x) = 223
NEXT x
board(12, 3) = 219
board(12, 38) = 219
board(3, 3) = 15
board(3, 38) = 15
board(21, 3) = 15
board(21, 38) = 15
END SUB

SUB InitDots (board())
   FOR x = 1 TO 23
      FOR y = 1 TO 40
         IF board(x, y) = 0 THEN board(x, y) = 249
      NEXT y
   NEXT x
   FOR x = 10 TO 14
      FOR y = 15 TO 26
         board(x, y) = 0
      NEXT y
   NEXT x
board(16, 20) = 0
END SUB

SUB MoveGhost (board(), x, y, g, f)
   RANDOMIZE TIMER
   z = INT(RND * 4) + 1
   IF board(x, y) = 15 THEN COLOR 11 ELSE COLOR 15
   SELECT CASE f
      CASE 1
         IF board(x - 1, y) <> 219 AND board(x - 1, y) <> 177 THEN
            LOCATE x, y: PRINT CHR$(board(x, y))
            x = x - 1
         END IF
      CASE 2
         IF board(x + 1, y) <> 219 AND board(x + 1, y) <> 177 AND board(x + 1, y) <> 23 THEN
            LOCATE x, y: PRINT CHR$(board(x, y))
            x = x + 1
         END IF
   END SELECT
   SELECT CASE z
      CASE 1 TO 2
         IF board(x, y - 1) <> 219 AND board(x, y - 1) <> 177 THEN
            LOCATE x, y: PRINT CHR$(board(x, y))
            IF board(x, y) = 32 AND y = 1 THEN y = 40 ELSE y = y - 1
         END IF
      CASE 3 TO 4
         IF y = 40 THEN
            LOCATE x, y: PRINT CHR$(board(x, y))
            y = 1
         ELSEIF board(x, y + 1) <> 219 AND board(x, y + 1) <> 177 THEN
            LOCATE x, y: PRINT CHR$(board(x, y))
            y = y + 1
         END IF
   END SELECT
   LOCATE x, y
   COLOR g
   PRINT CHR$(146)
END SUB

SUB MovePacman (board(), x, y, Man)
   x$ = INKEY$
   SELECT CASE x$
      CASE &quot;8&quot;
         IF board(x - 1, y) <> 219 AND board(x - 1, y) <> 177 THEN
            LOCATE x, y: PRINT &quot; &quot;
            x = x - 1
         END IF
         IF Man = 1 THEN
            Man$ = &quot;C&quot;
            Man = 0
         ELSE
            Man$ = &quot;O&quot;
            Man = 1
         END IF
      CASE &quot;2&quot;
         IF board(x + 1, y) <> 219 AND board(x + 1, y) <> 177 AND board(x + 1, y) <> 23 THEN
            LOCATE x, y: PRINT &quot; &quot;
            x = x + 1
         END IF
         IF Man = 1 THEN
            Man$ = &quot;C&quot;
            Man = 0
         ELSE
            Man$ = &quot;O&quot;
            Man = 1
         END IF
      CASE &quot;4&quot;
         IF board(x, y - 1) <> 219 AND board(x, y - 1) <> 177 THEN
            LOCATE x, y: PRINT &quot; &quot;
            IF board(x, y) = 32 AND y = 1 THEN y = 40 ELSE y = y - 1
         END IF
         IF Man = 1 THEN
            Man$ = &quot;C&quot;
            Man = 0
         ELSE
            Man$ = &quot;O&quot;
            Man = 1
         END IF
      CASE &quot;6&quot;
         IF y = 40 THEN
            LOCATE x, y: PRINT &quot; &quot;
            y = 1
         ELSEIF board(x, y + 1) <> 219 AND board(x, y + 1) <> 177 THEN
            LOCATE x, y: PRINT &quot; &quot;
            y = y + 1
         END IF
         IF Man = 1 THEN
            Man$ = &quot;C&quot;
            Man = 0
         ELSE
            Man$ = &quot;O&quot;
            Man = 1
         END IF
   END SELECT
   LOCATE x, y
   COLOR 14
   PRINT Man$
END SUB

SUB PrintBoard (board())
   FOR x = 1 TO 23
      FOR y = 1 TO 40
         IF board(x, y) = 219 THEN COLOR 1
         IF board(x, y) = 177 THEN COLOR 4
         IF board(x, y) = 249 THEN COLOR 15
         IF board(x, y) = 223 THEN COLOR 15
         IF board(x, y) = 15 THEN COLOR 11
         LOCATE x, y
         PRINT CHR$(board(x, y))
      NEXT y
   NEXT x
END SUB

SUB SetSpeed (Clock)
a$ = TIME$
DO WHILE a$ = TIME$: LOOP
a$ = TIME$
DO WHILE a$ = TIME$
   Clock = Clock + 1
LOOP
END SUB

Worked great on anything up to an early Pentium, but my CPU slowdown trick didn't work too well on newer machines.

There's a reason I'm not a programmer today!
3 Commodore file cabinets, 2 Commodore USB turntables, 1 AmigaWorld beer mug
Alienware M14x i7 laptop running AmigaForever
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show only replies by Karlos
Re: using those tiny little LCD screens as monitors...
« Reply #21 on: January 09, 2011, 02:26:28 PM »
Quote from: motorollin;605040
"FOR C = 1 TO 2" iterates twice - once when the value of C is 1, and again when the value is 2


Inclusive counting?!



Everything you need to know about what's wrong with BASIC is right there!
int p; // A
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: using those tiny little LCD screens as monitors...
« Reply #22 on: January 09, 2011, 02:32:22 PM »
Quote from: tone007;605047
All this BASIC talk reminded me of the lame ASCII Pacman I wrote back in the 90s in QBasic.


/looks for qbasic interpreter

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: using those tiny little LCD screens as monitors...
« Reply #23 on: January 09, 2011, 02:34:13 PM »
Quote from: Karlos;605048
Inclusive counting?!



Everything you need to know about what's wrong with BASIC is right there!


Surely it doesn't matter as long as you know? :)

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show only replies by Karlos
Re: using those tiny little LCD screens as monitors...
« Reply #24 on: January 09, 2011, 02:37:18 PM »
I guess I am just too used to the 0...N-1 method of counting ;)
int p; // A
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: using those tiny little LCD screens as monitors...
« Reply #25 on: January 09, 2011, 02:38:27 PM »
Quote from: Karlos;605057
I guess I am just too used to the 0...N-1 method of counting ;)


It never made much sense to me TBH. The inclusive method feels more logical to me. I sometimes still wonder why my loops don't iterate as many times as I expect them to :lol:

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show only replies by Karlos
Re: using those tiny little LCD screens as monitors...
« Reply #26 on: January 09, 2011, 02:42:01 PM »
Well, if you want to use the "inclusive" BASIC style looping, it's easy. Just change the < test for <= ;)
int p; // A
 

Offline AlfaRomeo

  • Newbie
  • *
  • Join Date: Jul 2010
  • Posts: 8
    • Show only replies by AlfaRomeo
Re: using those tiny little LCD screens as monitors...
« Reply #27 on: January 09, 2011, 02:50:11 PM »
Hi people,
I have a broken iPaq h5550 and love to make a monitor for my A600 from it´s LCD, I think it may have input lines for rgb.
Wonder to know if it´s possible to connect it..
 

Offline tone007

using those tiny little LCD screens as monitors...
« Reply #28 on: January 09, 2011, 02:52:36 PM »
My bet is no.
3 Commodore file cabinets, 2 Commodore USB turntables, 1 AmigaWorld beer mug
Alienware M14x i7 laptop running AmigaForever
 

Offline motorollin

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: using those tiny little LCD screens as monitors...
« Reply #29 from previous page: January 09, 2011, 02:53:39 PM »
Quote from: Karlos;605060
Well, if you want to use the "inclusive" BASIC style looping, it's easy. Just change the < test for <= ;)


Is x<=1 less efficient than x<2, both in interpreted and compiled code?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10