DataMuseum.dk

Presents historical artifacts from the history of:

RegneCentralen RC759 "Piccoline"

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RegneCentralen RC759 "Piccoline"

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦cad5e6730⟧ TextFile

    Length: 4098 (0x1002)
    Types: TextFile
    Names: »RSCREATE.C«

Derivation

└─⟦33b70227c⟧ Bits:30003931/GEM_Develop_disk_3_CDOS.imd Disketter indleveret af Steffen Jensen (Piccolo/Piccoline)
    └─⟦this⟧ »RSCREATE.C« 
└─⟦f18477172⟧ Bits:30003931/GEM_Develop_disk_1_CDOS.imd Disketter indleveret af Steffen Jensen (Piccolo/Piccoline)
    └─⟦this⟧ »SAMP\RSCREATE.C« 

TextFile

/*	RSCREATE.C	5/18/84 - 11/01/84	LKW		*/

#include "portab.h"
#include "machine.h"
#include "obdefs.h"
#include "rsrclib.h"

EXTERN WORD	dos_create();
EXTERN LONG	dos_write();
EXTERN VOID	dos_close();

WORD	beg_file;

RSHDR starthdr = 
æ
	0,		/* rsh_vrsn	*/
	0,		/* rsh_object	*/
	0, 		/* rsh_tedinfo	*/
	0,		/* rsh_iconblk	*/
	0,		/* rsh_bitblk	*/
	0,		/* rsh_frstr	*/
	0,		/* rsh_string	string data		*/
	0,		/* rsh_imdata	image data		*/
	0,		/* rsh_frimg	*/
	0,		/* rsh_trindex	*/
	0,		/* rsh_nobs	*/
	0,		/* rsh_ntree	*/
	0,		/* rsh_nted	*/
	0,		/* rsh_nib	*/
	0,		/* rsh_nbb	*/
	0,		/* rsh_nstring	*/
	0,		/* rsh_nimages	*/
	0		/* rsh_rssize	*/
å;

#include "example.rsh"

WORD  endfile;

main()   
æ
	WORD		jnk1, handle, ret;
	WORD		cnt;			/* in bytes	*/	

	starthdr.rsh_vrsn = 0;

	beg_file = (WORD) &starthdr;
	jnk1 = (WORD) &rs_object;
	starthdr.rsh_object = jnk1 - beg_file;
	jnk1 = (WORD) &rs_tedinfo;
	starthdr.rsh_tedinfo = jnk1 - beg_file;
	jnk1 = (WORD) &rs_iconblk;
	starthdr.rsh_iconblk = jnk1 - beg_file;
	jnk1 = (WORD) &rs_bitblk;
	starthdr.rsh_bitblk = jnk1 - beg_file;
	jnk1 = (WORD) &rs_frstr;
	starthdr.rsh_frstr = jnk1 - beg_file;
	starthdr.rsh_string = (WORD) rs_stringÆ0Å - beg_file;
	jnk1 = (WORD)rs_imdopeÆ0Å.image;
	starthdr.rsh_imdata = jnk1 - beg_file;
	jnk1 = (WORD) &rs_frimg;
	starthdr.rsh_frimg = jnk1 - beg_file;
	jnk1 = (WORD) &rs_trindex;
	starthdr.rsh_trindex = jnk1 - beg_file;

	starthdr.rsh_nobs = NUM_OBS;
	starthdr.rsh_ntree = NUM_TREE;
	starthdr.rsh_nted = NUM_TI;
	starthdr.rsh_nib = NUM_IB;
	starthdr.rsh_nbb = NUM_BB;
	starthdr.rsh_nimages = NUM_FRIMG;
	starthdr.rsh_nstring = NUM_FRSTR;

	fix_trindex();
	fix_objects();
	fix_tedinfo();
	fix_iconblk();
	fix_bitblk();
	fix_frstr();
	fix_frimg();

	handle = dos_create( ADDR(&pname), F_ATTR); 

	cnt = ( ((BYTE *)&rs_imdopeÆ0Å) - ((BYTE *)&starthdr) );
	starthdr.rsh_rssize = cnt;
	ret = dos_write(handle, (LONG) cnt, ADDR(&starthdr) ); 

    dos_close(handle);
å

fix_trindex()
	æ
	WORD	test, ii;

	for (ii = 0; ii < NUM_TREE; ii++)
		æ
		test = (WORD) rs_trindexÆiiÅ;
		rs_trindexÆiiÅ = (WORD) &rs_objectÆtestÅ - beg_file;
		å
	å

fix_objects()
	æ
	WORD	test, ii;

	for (ii = 0; ii < NUM_OBS; ii++)
		æ
		test = (WORD) rs_objectÆiiÅ.ob_spec;
		switch (rs_objectÆiiÅ.ob_type) æ
			case G_TITLE:
			case G_STRING:
			case G_BUTTON:
				fix_str(&rs_objectÆiiÅ.ob_spec);
				break;
			case G_TEXT:
			case G_BOXTEXT:
			case G_FTEXT:
			case G_FBOXTEXT:
				if (test != NIL)
				   rs_objectÆiiÅ.ob_spec = 
					(WORD) &rs_tedinfoÆtestÅ - beg_file;
				break;
			case G_ICON:
				if (test != NIL)
				   rs_objectÆiiÅ.ob_spec =
					(WORD) &rs_iconblkÆtestÅ - beg_file;
				break;
			case G_IMAGE:
				if (test != NIL)
				   rs_objectÆiiÅ.ob_spec =
					(WORD) &rs_bitblkÆtestÅ - beg_file;
				break;
			default:
			å
		å
	å

fix_tedinfo()
	æ
	WORD	ii;

	for (ii = 0; ii < NUM_TI; ii++)
		æ
		fix_str(&rs_tedinfoÆiiÅ.te_ptext);
		fix_str(&rs_tedinfoÆiiÅ.te_ptmplt);
		fix_str(&rs_tedinfoÆiiÅ.te_pvalid);
		å
	å

fix_frstr()
	æ
	WORD	ii;

	for (ii = 0; ii < NUM_FRSTR; ii++)
		fix_str(&rs_frstrÆiiÅ);
	å

fix_str(where)
	LONG	*where;
	æ
	if (*where != NIL)
  	  *where = (LONG)((BYTE *) rs_stringsÆ(WORD) *whereÅ - beg_file);
	å

fix_iconblk()
	æ
	WORD	ii;

	for (ii = 0; ii < NUM_IB; ii++)
		æ
		fix_img(&rs_iconblkÆiiÅ.ib_pmask);
		fix_img(&rs_iconblkÆiiÅ.ib_pdata);
		fix_str(&rs_iconblkÆiiÅ.ib_ptext);
		å
	å

fix_bitblk()
	æ
	WORD	ii;

	for (ii = 0; ii < NUM_BB; ii++)
		fix_img(&rs_bitblkÆiiÅ.bi_pdata);
	å

fix_frimg()
	æ
	WORD	ii;

	for (ii = 0; ii < NUM_FRIMG; ii++)
		fix_bb(&rs_frimgÆiiÅ);
	å

fix_bb(where)
	LONG	*where;
	æ
	if (*where != NIL)
  	  *where = (LONG)((BYTE *) &rs_bitblkÆ(WORD) *whereÅ - beg_file);
	å
	
fix_img(where)
	LONG	*where;
æ
	if (*where != NIL)
	  *where = (LONG)((BYTE *) rs_imdopeÆ(WORD) *whereÅ.image - beg_file);
å
«eof»