To use command graphics basic (LINE,DRAW,CIRCLE,PAINT) in code assembler

Page 1/4
| 2 | 3 | 4

By gasparrini

Champion (325)

gasparrini's picture

28-07-2009, 15:48

Hi Guys,

I would like know as I can to use all the command basic
graphics in SCREEN2 of: LINE,DRAW,CIRCLE,PAINT, PRESET,PSET,PRINT#1,"TEXT"
and OPEN"GRP:"AS#1 in code assembler.
For me is important because I need of fast speed in basic screen2.

Remember you, I want please, source assembler for CHAOS ASSEMBLER, Thanks

I hope of not to ask too to you....
^_^ eh... eh... ^_^
****************************************************************

See you later
Bye
Andrea

Login or register to post comments

By JohnHassink

Ambassador (5587)

JohnHassink's picture

28-07-2009, 15:54

Hi Andrea, unfortunately I cannot help you with that.
You seem to be quite crafty with BASIC.
Have you ever tried NestorBASIC?

By Leo

Paragon (1236)

Leo's picture

28-07-2009, 15:56

i have a book on MSX2 that explains that , basically for each function you have a bios or subrom address , you call it with HL as an argument like :

ld hl,txt_basic_pointer
call subrom_function_for_drawing_a_line

txt_basic_pointer :
db '(0,0)-(123,12),12',0

I know this is not ready to use but i gives you an idea of the process , i dont have the book in front of me right now so i can give the exact address in bios.

a nice page to visit for you :
http://map.grauw.nl/resources/msxbios.php

By gasparrini

Champion (325)

gasparrini's picture

28-07-2009, 16:40

Hi DemonSeed, Hi Leo,

Unfortunately I am tired of to used the nestor basic,
for me is thing old!!
I prefer to learn programming in assembler, because
it it better!! ^_^

Because I need of make ROMS videogames..... ^_^

Post for Leo, your routine example is only a example
because if I compile doesn't work because is without
address routine code from BIOS MSX-BASIC.

I have see site http://map.grauw.nl/resources/msxbios.php
but it is all in english, and I with the english I am a mule!!
If it was in language italian were all a other thing, Ok??

Then, now I ask to you if can do of the example of as work
assembler for make graphics as command basic.

I hope than there is somebody then me can help me, Ok???

Thank you
See you later....
Andrea

By nikodr

Paladin (747)

nikodr's picture

28-07-2009, 18:16

I dont think that using bios to draw lines would be good.These routines are good but not so good when you want to create a fast game with many sprites and action,what exactly you want to do?
Open a screen (example screen 2,4,5) and use asm to generate graphics?

By Jipe

Paragon (1504)

Jipe's picture

28-07-2009, 18:30

for learning assembler look into the other MSX games

shem is a good util for easy desassemble a 16k or 32k game

and sure my english is very bad but is the way for answer the MSX on the Net

other way is japan but more difficult

By jltursan

Prophet (2542)

jltursan's picture

28-07-2009, 19:05

LINE,DRAW,CIRCLE,PAINT, PRESET,PSET,PRINT#1,"TEXT"
and OPEN"GRP:"AS#1 in code assembler

If you need this kind of instructions in a game, it for sure can be coded in BASIC. Calling the BIOS routines directly from BASIC is not a very good idea because you'll mess up the code without virtually no gain in speed.

You must try to learn the sprites management and how the VDP works, specially tile mode.
Sadly I can't point you any MSX italian resources (tutorials, articles, guides, etc); but I'm sure that it must be something out there in the net...

I don't know Chaos Assembler; but it must be like other hundreds of assemblers; so, have you tried to compile ready-made extremely simple examples like the ones found in Karoshi's forum snippets thread?
Most of them run out-of-the-box compiling with asMSX or with others like sjasm, tniasm or chaos oing only with minor cosmetic changes.

By PingPong

Prophet (3767)

PingPong's picture

28-07-2009, 19:10

@gasparini: the gfx bios routines are kinda of slow thing, maybe if you want speed you should take a look to http://it.wikipedia.org/wiki/Algoritmo_della_linea_di_Bresenham algos and implement linedrawing directly in asm.

there is also a circle algo one from the same people. Both algos works with integer math, so they are easily doable in asm.

By Leo

Paragon (1236)

Leo's picture

28-07-2009, 19:51

Maybe he just want to start learning asm and get quickly visible results using bios routines , and then see the limitations by himself and speedup what he needs for his game ... it is difficult to read tons of docs just before drawing a pixel ... it is not that easy to fill the gap between "inc a" and "ld a,(hl)" and sprite moving on the screen on a colored scene...
Maybe his games does not need that speed also

Tongue

By Leo

Paragon (1236)

Leo's picture

28-07-2009, 21:11

ok lets make some basic italian:

Questo picolo asm source lo compilo con gen80 , fa qualcose que si sembra a un
programma basic cosi :

10 screen 2
20 line (12,30)-(130,160),9
30 goto 30

Non lo ho compilato ni una soltanta volta !

;----------------------------
bios_line equ 058fch
bios_basic equ 00159h
gxpos equ 0fcb3h
gypos equ 0fcb5h
chgmod equ 005Fh
setatr equ 011Ah

.org 4000h

db "CD"
dw init
dw 0,0,0,0,0,0

init:
ld a,2
call chgmod

ld a,9
call setatr

ld hl,12
ld (gxpos),hl
ld hl,30
ld (gypos),hl
ld bc,130
ld de,160
ld ix,bios_line
call bios_basic

fine:
jp fine
;------------------------

By gasparrini

Champion (325)

gasparrini's picture

28-07-2009, 23:18

Hi Leo,

Thank you for your help for me!
Of course than the your italian language is not
very nice as my.... Eh..Eh...
Of course than also my english is very Bad!! True?? ^_^
Then, I would like know as I can do for make LINE BOX
and to paint:

Example: line (12,30)-(130,160),9,BF

Do BOX color 9 (red light) and PAINT BOX, can you make programm
in assebler please??

Then, already then we are here, Could do you do a programm
in assember for make a circle??

See you to soon...
Good Night
Andrea

Page 1/4
| 2 | 3 | 4