Jump to content
IGNORED

Assembly->XB link project


Opry99er

Recommended Posts

Well if I can simply use the assembly data from the Magellan output without offsetting anything, that would be great! I thought both the assembler output and the XB would have to be shifted. >20 and 32 are the same, so why would >20 work and not "32"?

We will have to offset once only. Either outside your assembler program or within. >20 is the same as 32.

 

If that is the case--- that I don't need to shift the assembler output, then that's what I will do. I only wrote the converter program because I was under the impression that when linking assembly and XB that the data had to be shifted regardless....

Converting outside is an extra manual step. Manual steps add to the chance of a mistake happening. Every time you update the map, you'll have to convert. Converting inside adds a tiny fraction of time to the drawing of the viewport, but you won't notice. And we'll write our own fast version of VMBW. If and when we move away from XB, we can drop the offset, use the data as is, won't need or wait for utilities to load (CALL INIT) and will have more room in RAM (much more actually).

Edited by sometimes99er
Link to comment
Share on other sites

I wasn't aware that the time it takes to convert would be so minimal. :)

Compared to the execution of XB itself, it's nothing. But the main super loop moving bytes from RAM to VDP may be 30% slower (rough estimate). Overall much less. You'll go from instant coffee to instant coffee. As I said, you won't notice.

Edited by sometimes99er
Link to comment
Share on other sites

That's great! Thanks alot. :)

 

I wasn't aware that the time it takes to convert would be so minimal. :)

I hate to repeat what I just said. ;)

(looks like post #102 and #104 are exactly the same)

 

I need you to add your own VMBV to your code. Only that. It should add about 11 instructions. You don't have to compile, run etc. Take a look at how it's done elsewhere like with Melt by Marc, Yin Yang by Matthew, Game Of Life by Mark or Spectra by Filip.

Edited by sometimes99er
Link to comment
Share on other sites

Here's Marc's Melter program

 

  	DEF  MELT

VDPWA  EQU  >8C02
VDPWD  EQU  >8C00
VDPRD  EQU  >8800


BUF	BSS  768



MELT   LI   R6,->0100
  	LI   R0,0
  	LI   R1,BUF
  	LI   R2,768

  	SWPB R0
  	MOVB R0,@VDPWA
  	SWPB R0
  	MOVB R0,@VDPWA
VMBW   MOVB @VDPRD,*R1+
  	DEC  R2
  	JNE  VMBW




START  LI   R1,BUF
  	CLR  R5
LOOP1  CLR  R2
  	MOVB *R1,R2
  	CI   R2,>8000
  	JEQ  NEXT
  	JL   ADJUST
  	A	R6,R2
  	AI   R6,->0100
  	CI   R6,->1F00
  	JNE  NOREST
  	LI   R6,->0100


NOREST LI   R5,1
  	MOVB R2,*R1
  	JMP  NEXT
ADJUST LI   R2,>8000
  	LI   R5,1
  	MOVB R2,*R1
NEXT   INC  R1
  	CI   R1,BUF+768
  	JNE  LOOP1

  	CI   R5,0
  	JEQ  DONE


  	CLR  R0
  	LI   R1,BUF
  	LI   R2,768

  	ORI  R0,>4000      	(THIS ROUTINE CHANGES THE
  	SWPB R0         		MEMORY CONTENTS)
  	MOVB R0,@VDPWA
  	SWPB R0
  	MOVB R0,@VDPWA
  	NOP
VMBW1  MOVB *R1+,@VDPWD
  	DEC  R2
  	JNE  VMBW1
  	LI   R0,>9F00
  	MOVB R0,@>8400 		TURN SOUND OFF FOR OWENS PROG



  	JMP  START


DONE   RT
  	END  MELT

 

I guess I'm having difficulty finding the ACTUAL VMBW routine in here... this looks like the spot (but I'm only basing that on the label VMBW1)

 

CLR  R0
  	LI   R1,BUF
  	LI   R2,768

  	ORI  R0,>4000      	(THIS ROUTINE CHANGES THE
  	SWPB R0         		MEMORY CONTENTS)
  	MOVB R0,@VDPWA
  	SWPB R0
  	MOVB R0,@VDPWA
  	NOP
VMBW1  MOVB *R1+,@VDPWD
  	DEC  R2
  	JNE  VMBW1
  	LI   R0,>9F00
  	MOVB R0,@>8400 		TURN SOUND OFF 

 

I'll keep studying.... perhaps I just haven't spent enough time with it yet. Right now I'm looking into Matthew's routines... They are very thoroughlly commented. =)

Edited by Opry99er
Link to comment
Share on other sites

***WARNING***

 

*This post contains information that in NO WAY relates to the VMBW routines I'm currently working on. I know this is outside the assembly talk, but maybe it's not...

 

If I'm re-drawing the viewport each time the PC exits the screen, I could have a different character set (or partially different character set) each time the screen re-draws. That means I could go from the "typical forest" area look to a "dark forest" look, and maybe even a tileset-expensive castle graphic or something. I'm just thinking out loud here, but it's possible to trick the player into thinking, like, maybe I have alot more tiles to play with. =) I feel like Donald Sutherland in the movie "Kelly's Heroes" right now.

 

***BACK TO REAL ASSEMBLY TALK NOW***

Link to comment
Share on other sites

***WARNING***

 

*This post contains information that in NO WAY relates to the VMBW routines I'm currently working on. I know this is outside the assembly talk, but maybe it's not...

 

If I'm re-drawing the viewport each time the PC exits the screen, I could have a different character set (or partially different character set) each time the screen re-draws. That means I could go from the "typical forest" area look to a "dark forest" look, and maybe even a tileset-expensive castle graphic or something. I'm just thinking out loud here, but it's possible to trick the player into thinking, like, maybe I have alot more tiles to play with. =) I feel like Donald Sutherland in the movie "Kelly's Heroes" right now.

 

***BACK TO REAL ASSEMBLY TALK NOW***

I think I understand maybe half of it. Whatever it is, it is of course possible. But I think it would be easier to add USB 3.0.

 

;)

Edited by sometimes99er
Link to comment
Share on other sites

Okay--- I'll be out of town all day today--- playing a show tonight, so I don't imagine I'll have much time until late tonight to work on this.... I'll be doing just what you asked tonight

So was it a good show ? Weren't you in the studio previously also ?

 

We've been invited to eat at one of the neighbors, so I'll be back in about 4 hours.

 

:)

Edited by sometimes99er
Link to comment
Share on other sites

Yea, our most recent shoot was with a pro. The older shoot when we had the skinny white bassist was not pro. =) Marcelo Bakos (our new bassist) is from Brazil, and he is freaking amazing. That last 12 pix in the pics folder are with Marcelo and we had a pro photographer.

 

BTW I just listened to a couple of the tracks and they aren't the most recent ones. I need to update the music.... We were posting songs as we got new mixes from the studio and the tracks on the facebook site are all old mixes... they don't even have all the instrumentation in them. =) I'll get it updated today if I can find time around coding this RPG Lite, playing Chrono Trigger, and watching my kid. =)

 

 

Link to comment
Share on other sites

Hey sometimes... could we use a series of VSBWs and offset each one before we write it? Instead of using a MBW, I mean... It seems like a simple thing to accomplish, doesn't it?

Well, VSBW sets the address of the VDP and transfers one byte. VMBW sets the address and transfers many bytes - taking advantage of the VDP auto incrementing address.

 

We'll do our own VMBW, then go into its stomach and do the offset there. It will execute like 5-10 times faster (than using a series of VSBWs).

 

:)

Edited by sometimes99er
Link to comment
Share on other sites

Here's one Marc wrote:

 

CLR  R0
       LI   R1,BUF
       LI   R2,768

       ORI  R0,>4000           (THIS ROUTINE CHANGES THE
       SWPB R0                         MEMORY CONTENTS)
       MOVB R0,@VDPWA
       SWPB R0
       MOVB R0,@VDPWA
       NOP
VMBW1  MOVB *R1+,@VDPWD
       DEC  R2
       JNE  VMBW1
       LI   R0,>9F00
       MOVB R0,@>8400          

 

 

Here's the one I found that Matthew wrote...

 

VMBW   MOVB @R0LB,@VDPWA  	* Send low byte of VDP RAM write address
  	ORI  R0,>4000      	* Set read/write bits 14 and 15 to write (01)
  	MOVB R0,@VDPWA     	* Send high byte of VDP RAM write address
VMBWLP MOVB *R1+,@VDPWD   	* Write byte to VDP RAM
  	DEC  R2            	* Byte counter
  	JNE  VMBWLP        	* Check if done
  	B	*R11
*// VMBW

Link to comment
Share on other sites

I'm studying "ORI" right now.... Looks like it compares two words and sets the bits to the new word if either of the bits are set in either of the compared words. Therefore:

 

0101100110011001
and
0011101111000100 
becomes

0111101111011101

 

I guess I'm just trying to figure out why this is so crucial in a VDP write routine....

Edited by Opry99er
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...