Jump to content
IGNORED

Rastaconverter image exit


Philsan

Recommended Posts

Can someone please modify the attached Rastaconverter's "no_name.asq" so that Rastaconverter image xex exits after 5 seconds (instead of pressing fire, start or a key)?

 

Here is the part to be changed


//--------------------
//	EXIT
//--------------------

	lda trig0		; FIRE #0
	beq stop

	lda trig1		; FIRE #1
	beq stop

	lda consol		; START
	and #1
	beq stop

	lda skctl		; ANY KEY
	and #$04
	bne skp

Thanks!

no_name.zip

  • Like 2
Link to comment
Share on other sites

Here's a bit of code that should be good for PAL and NTSC.

rtclok = $12
pal = $D014
  ldy #5 ; 5 seconds
delay1
  lda pal
  and #$0A ; gives 0 for PAL, 10 for NTSC
  clc
  adc #50
  tax
delay2
  lda rtclok+2
delay3
  cmp rtclok+2
  beq delay3 ; delay single frame
  dex
  bne delay2 ; delay 1 second
  dey
  bne delay1 ; delay x 5
; returns here

It could be simplified a bit but for the sake of several bytes when an RC pic is about 16K, does it matter?

 

If you wanted to incorporate manual exit like normal, put that stuff before the "dex" though if using X or Y you'd need to save/restore them.

Edited by Rybags
  • Like 5
Link to comment
Share on other sites

As the standard file of rasterconverter switches off the os. using rtclock won't work.

 

For the 5 sec Philsan wants, you can simply use a byte and increment it every vbl and if reaches 250 you can quit after around 5 sec with PAL a bit less when NTSC.

//--------------------
//	EXIT
//--------------------
        lda tmer
        cmp #250
        beq stop
        inc tmer

	lda trig0		; FIRE #0
	beq stop

	lda trig1		; FIRE #1
	beq stop

Don't forget to set tmer to zero at start and then use 'ini main' instead 'run main' if you want to load next part of multi linked file.

 

If you want to have more or correct waiting time use real timer interrupt instead.

Edited by pps
  • Like 6
Link to comment
Share on other sites

Here we go with the "final" solution of this problem:

 

We use 2 bytes to determine what time's gone by - tmer and tmer2

     lda tmer
     cmp #50
     bne go_further
     mva #0 tmer
     inc tmer2
     lda tmer2
     cmp #10
     beq stop

go_further
     inc tmer

This is PAL version. For NTSC use 'cmp #60' instead 'cmp #50'.

 

Imho we don't need to check if we have pal or ntsc, as the pictures look very strange when not converted with the corresponding pallette for the machine.

 

tmer2 is used for the exact amount of time in sec you want to display the picture.

 

EDIT: There must be some work done to have a nice screen when loading the next picture. If not you might get screen garbage on ATARI screen (Emulator has sio patch, so you don't recognize it.).

Edited by pps
  • Like 2
Link to comment
Share on other sites

If you want to have a clean screen between the pictures you can't just reinitiate the OS and then rts as in the original source. You'll get screen garbage of the "old" picture while loading.

 

To prevent this best way is to show up a little info that more is coming and - that's the important thing - wait till vbl is set and the "loading screen" is shown. Then do the rts.

 

snap shot of no_name.asq:

//--------------------
//	EXIT
//--------------------

//--------------------
//   Timer
//--------------------
	lda tmer
	cmp #50
	bne go_further
	mva #0 tmer
	inc tmer2
	lda tmer2
	cmp #10
	beq stop

go_further
	inc tmer
//--------------------
	
	lda trig0		; FIRE #0
	beq stop

	lda trig1		; FIRE #1
	beq stop

	lda consol		; START
	and #1
	beq stop

	lda skctl		; ANY KEY
	and #$04
	bne skp

stop	mva #$00 pmcntl		;PMG disabled
	tax
	sta:rne hposp0,x+

	mva #$ff portb		;ROM switch on
	mva #$40 nmien		;only NMI interrupts, DLI disabled
	cli			;IRQ enabled

	mwa #ant_scr 560

	lda:cmp:req $14		;wait 1 frame

	rts			;return to ... DOS
skp

//--------------------

	jmp LOOP

;---

wait54cycle
	:2 inc byt2
wait44cycle
	inc byt3
	nop
wait36cycle
	inc byt3
	jsr _rts
wait18cycle
	inc byt3
_rts	rts

byt3	brk

//--------------------------
	org $0600
ant_scr
	.he 70 70 70 70 70 70 70
	.he 42
	dta a(ld_scr)
	.he 41
	dta a(ant_scr)

ld_scr
	dta d"         please wait for next           "
//--------------------------

This should work fine now.

 

btw. you can left out the disable basic code in the second picture file, as it is switched off by the first picture.

* ---	BASIC switch OFF
	org $2000\ mva #$ff portb\ rts\ ini $2000
Edited by pps
  • Like 3
Link to comment
Share on other sites

  • 4 weeks later...

Thanks to pps for pointing me here. Not sure how I missed it before.

 

I'm not sure how beneficial it would be, but there should be enough memory to leave DOS on in a 48K machine with a bit of reorganizing of the no_name memory space:

 

I suppose the biggest Rasterconverter picture could stuff registers on every line in 54 of the 57 available cycles. 9x5* bytes=45 + the 2 filler bytes for the 3 remaining cycles = 47. *Corrected*

For full 240 height:

program: 240x47=11280 (ouch)

bitmap: 240x40=9600 plus some alignment bytes

players: 1024

DLIST: 720

+Viewer code

total: <23k

Still doable with DOS

Edited by Sheddy
Link to comment
Share on other sites

Referring back to the RasterConverter picture thread, there is a small amount of interest in a slideshow program for RastaConverter pictures.

 

Although people have found it is just about possible with some DOSes to chain load the xex files without them crashing on exit, as suggested, it would be nice to be able to rely on an already running VBI to pick up the real time clock and to do other slideshow things.

 

I would personally want them to work as stand alone pictures as well, which I think ought to be possible.

 

I am working on a decompiler/optimiser script that should help make existing xex pictures more amenable to tweaks of the default build program.

 

Working on that, I only recently realised it would ideally need to be able to decompile the more optimised program kernel too (Doh!). That is a bit harder to parse.

 

At that stage a better way would need a proper format for RastaConverter, at least for the program kernel. Maybe a bytecode that gets compiled at run time? Maybe that isn't needed if just a general compressor is used. The bitmap and sprites could certainly benefit from that. Will probably post a new topic asking about that some more.

  • Like 3
Link to comment
Share on other sites

I can program a little, even a little assembler, but it's something I do only a few times each decade (yes, 'decade'). I would like my system to return to the mypicodos (v4.06) menu after displaying a picture. I realize this is not a real DOS. An RTS is not going to work. Would modifying NO_NAME.ASQ with a JMP $E477 be good enough?

 

p.s. The current code at exit does some housekeeping and then PLA, PLA, JMP ($0A) [DOSVEC?], RTS. Why does it crash?

Edited by a8isa1
Link to comment
Share on other sites

Well, I simply use the method Reset=reboot (coldstart) and since I am still using disks and disk-images (and most of them are 90k/130k/180k), such a reboot does not take that long...

 

DOS needs "many" seconds to boot (or to return to when it is not in RAM anymore, e.g. with DOS 2.0 or DOS 2.5 the DUP.SYS with 42 sectors has to be reloaded), MypicoDOS is somewhat faster (still some 30 sectors to load), NanoDOS/MicroDOS/PicoDOS are still faster (boot sectors + dir sectors have to be loaded), Bootloaders are even faster (only 3 bootsectors to boot/load, e.g. Fender's 3 sector bootloader)...

 

Most of the time I use Superpacker/Exomizer by TeBe to pack a Rasta pict. so its length is somewhere in the 8k-16k range and I also add a Basic-off routine and a Reset=coldstart routine to it. But that has to be done manually then to every Rasta pict. Afaik, Fender's 3-sector bootloader also includes an option to set Reset to reboot, have not tested if it works successfully with the Rasta pics (if so, I only need to write the bootloader to the 90k/130k/180k disk and there would be no need to modify the Rasta pics for a coldstart)...

 

But if you need a reboot for a 16MB "disk", you should use MyPicoDOS, it switches Basic off automatically, afaik also does a reboot on Reset (if the program is not reset-proof) and supports MyDOS subdirs (so you can sort your Rasta pics from A-Z). Use a joystick to choose and firebutton to load a Rasta pict. and press Reset to reboot the HDD partition or ATR-image.

BASOFF.xex

COLDSTA.XEX

MENUMAKE.xex

Rasta25.atr

Edited by CharlieChaplin
  • Like 3
Link to comment
Share on other sites

...

Most of the time I use Superpacker/Exomizer by TeBe to pack a Rasta pict. so its length is somewhere in the 8k-16k range and I also add a Basic-off routine and a Reset=coldstart routine to it. But that has to be done manually then to every Rasta pict. Afaik, Fender's 3-sector bootloader also includes an option to set Reset to reboot, have not tested if it works successfully with the Rasta pics (if so, I only need to write the bootloader to the 90k/130k/180k disk and there would be no need to modify the Rasta pics for a coldstart)...

...

As far as I see, 'BASIC off' isn't needed, as the rastaconverter default no_name.asq has this bult in at the front of it.

for having a coldstart after pressing console, trigger or key simply search (in no_name.asq) for:

rts			;return to ... DOS

and replace it with.

jmp $e477			;perform a reset

From now on every rastapic you create will end performing a reset call.

Then use the Superpacker to compress the pic, if aou want shorter file size. For me Superpacker works best in Exomizer mode - depacker start $0400, decrunch disable screen, so you can use $bc40 for buffer.

 

PS: Superpacker in latest version (5.9) has some error when overwriting a file. In W10FCU the 'overwrite warning messagebox' is not shown full, so you only can leave it (and have to choose a different filename instead) by pressing enter for abort/cancel this box. Superpacker 5.6 works fine there as it uses windows standard message box.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...