C compiler comparison - part two

Page 5/5
1 | 2 | 3 | 4 |

Par lak

Rookie (21)

Portrait de lak

12-09-2009, 07:56

Hey,
Currently reading up on stuff (so much info) and of course playing games.
Need to get my shit together.
Thanks. Will seek you out if stumped.

regards

Par ARTRAG

Enlighted (6843)

Portrait de ARTRAG

12-09-2009, 09:38

send me an email and I'll share whatever I can
from demo projects to unfinished games
my gmail is in my profile
it would be nice to have another HTC developer here on MRC ;-)

Par lak

Rookie (21)

Portrait de lak

21-09-2009, 05:30

Hi Artrag,
I've read through all past mails.....
I've modified the gfx.libs and v7.8 cross compiled all ex0..ex12.
Everthing ok except:
1) Ex11 (Spinning triangle) runs but some spillage on the vertexes when shaded solid. The original Ex11.com looks good.
(I failed trigonometry in school.)
2) Ex8 ? bmove is missing. Need to copy from CP/M version or use memmove with to, from crossed( I don't know)

Can recollect old thoughts ? Danke.

Par ARTRAG

Enlighted (6843)

Portrait de ARTRAG

21-09-2009, 08:35

hi lak
i think you are porting jannone's libs to HTC v7.8
I started the same work back in 2004 to abandon it soon
Passing trough all that ram/rom slot swapping is very slow and can be worth only for initialize the screen
accessing directly to the vdp for sending commands is much faster
About bmove, yes, some libs in the cpm model are missing
I've found the same problem when trying to use disk I/O in the libs
After, I've developed my own I/O disk functions by calling directly the msxdos2

what i can share are sample projects for:
.com files using my disk I/O libs
.com files using my vdp libs (very barebone)
.rom files of 32K or 48K plain roms
.rom files of scc megaroms (segment management done by htc)

Par lak

Rookie (21)

Portrait de lak

02-10-2009, 12:58

Hi Artrag,
Maybe a simple demo in .rom files of scc megaroms (segment management done by htc (great!))
will set me on my way.
(I've used zworld z180s in my last job and have lost touch with banking methods and asm on traditional z80's computers.
The zworld 'c' compiler uses the mmu transparently to the user. Works well but programmer becomes stupid.)

live long and prosper
lak

Par ARTRAG

Enlighted (6843)

Portrait de ARTRAG

02-10-2009, 18:46

send me an email
(it is in my profile)
I'll flood you of examples
:-)

Par ARTRAG

Enlighted (6843)

Portrait de ARTRAG

03-10-2009, 09:02

The HTC compiler can manage megaroms transparently once you have supplied your own asm for page swapping.
You can have even 1Mbyte of code and data in the same project, according to the mapper you choose.
The limit is the fact that the original design of the compiler was done with the z180 MMU in mind.

The z180 (you already know) has one base area and a paged area that moves at 4 k steps into the address space of the cpu.
This means that there is only one paged area to access to far data in rom.
This limit applies also to the HTC setup, where our msx mappers could have instead 4 independent pages in theory.

I think to the matter in this way:
we have a 32K viewport on the megarom addresses (it is the simplest case, but it can be larger or smaller) where:
an area is fixed (functions and data are always accessible), say 8K of “base” rom and an area is swapped (functions and data are accessed with paging), say 24K of “far” rom.

The fixed area is open permanently on the very same page of the megarom.
The swapped area be open on different pages of the megarom (the "far" area).

Functions and data in far rom, internally, are called passing trough ancillary functions (lcall and lret) that you have to provide (I did them, do not worry ;-) according to the mapper you have chosen (SCC, ASCI etc. etc).

In C all you need is to add the declaration basenear to the functions you want in base rom.

The compiler will distribute the other functions across the pages in far rom.
This latter results split in “segments” of 24K (in our case).

Constant C data that you do not want to be copied in RAM (this is the standard C behavior, you know) can be flagged with the declaration “code” and they will stay in the segment of the function that accesses them.

The tricky point is that constant data in rom can be accessed only by the functions in base rom and by the functions within the same segment.

Let me know

Par lak

Rookie (21)

Portrait de lak

10-10-2009, 04:49

Hi Artrag,

you've got gmail...I hope.

regards

Par lak

Rookie (21)

Portrait de lak

10-10-2009, 04:54

Great. I'll get on it.
Thanks for refreshing my 45 year old brain on this.

Par ARTRAG

Enlighted (6843)

Portrait de ARTRAG

10-10-2009, 09:20

sample project mailed

Page 5/5
1 | 2 | 3 | 4 |