Jump to content

Photo

Mad-Assembler (MADS)


115 replies to this topic

#101 tebe OFFLINE  

tebe

    Dragonstomper

  • 792 posts
  • Location:Poland

Posted Sat Jan 5, 2019 3:12 AM

.cb +$80 "Hello"*


Wratchild win ;)

Edited by tebe, Sat Jan 5, 2019 3:14 AM.


#102 Sheddy ONLINE  

Sheddy

    Dragonstomper

  • 772 posts
  • Location:UK

Posted Sat Jan 5, 2019 4:11 AM

:) Not really, does same as

.cb "Hello"

no good for screen display unless custom charset



#103 tebe OFFLINE  

tebe

    Dragonstomper

  • 792 posts
  • Location:Poland

Posted Sat Jan 5, 2019 4:31 AM

Yep, thanks. looks like I'll have to be doing that.

On another note, is .align supposed to work to exact bytes rather than just pages? Not that it turns out to be that useful for padding out to 128 byte sectors, but when I was experimenting it seems to behave peculiarity with things like ".align $7f"?


.align N[,fill_value]

how it works:
 
  if N > 0 then
   i := (CURRENT_ADDRESS div N)* N
  else
   i := CURRENT_ADDRESS;

  if i <> CURRENT_ADDRESS then inc(i, N);

  CURRENT_ADDRESS := i;

Edited by tebe, Sat Jan 5, 2019 4:33 AM.


#104 Sheddy ONLINE  

Sheddy

    Dragonstomper

  • 772 posts
  • Location:UK

Posted Sat Jan 5, 2019 5:05 AM

.align N[,fill_value]

how it works:
 

  if N > 0 then
   i := (CURRENT_ADDRESS div N)* N
  else
   i := CURRENT_ADDRESS;

  if i <> CURRENT_ADDRESS then inc(i, N);

  CURRENT_ADDRESS := i;
	opt h- f+
	
	org $2000
	
	.byte 1,2,3
	
	.align $7f,0
	
	.byte $ff
01 02 03 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF

only 64?

change to ".align $7e,0"

01 02 03 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 FF

?



#105 Wrathchild ONLINE  

Wrathchild

    River Patroller

  • 2,233 posts
  • Location:Reading, UK.

Posted Sat Jan 5, 2019 6:06 AM

:) Not really, does same as

.cb "Hello"

no good for screen display unless custom charset

 

Haha, of course it doesn't, it adding $80 to each char and EOR that with $80 :)

 

I understand now that there is no equivalent for the .cb function for ATASCII output of .sb as the latter doesn't have the same behaviour of .cb which inverts the last character.



#106 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,780 posts
  • Location:Bay Area, CA, USA

Posted Sat Jan 5, 2019 2:23 PM

	opt h- f+
	org $2000
	.byte 1,2,3
	.align $7f,0
	.byte $ff

only 64?

 

You are requesting alignment to the nearest 127 byte boundary. ceil($2000 / $7F)*$7F = $203F.



#107 Sheddy ONLINE  

Sheddy

    Dragonstomper

  • 772 posts
  • Location:UK

Posted Sat Jan 5, 2019 3:02 PM

Oh, I see now. Thanks

#108 matosimi OFFLINE  

matosimi

    Moonsweeper

  • 354 posts
  • Location:Slovakia - Bratislava http://matosimi.atari.org

Posted Sun Jan 6, 2019 5:17 AM

Hi, I'm having another dilema.

 

I have one file which contains data for 5 levels.

Each level data is let's say 64 bytes long.

My goal is to generate 5 binary files which will eventually be deflated and unrolled to actual level data buffer during gameplay.

 

Are there any mads directives that could I use for this?

I was thinking of .SAV, but I'm dont know how to fill the buffer with .PUT.

 

All that i need is some command similar to what .writemem in altirra does, but instead of writing data that are in the emulator ram, I would need to write part of data within some datablock.

 

data could look like this:

org $3000
level1
:64 dta 1
level2
:64 dta 2
level3
:64 dta 3
level4
:64 dta 4
level5
:64 dta 5

and what I would like to do is something like:

savetofile level1, level2-level1, "level1.bin"
savetofile level2, level2-level1, "level2.bin"
... and so on

(start address, length, filename)

so the result will be 5 files level1.bin ... level5.bin each 64byte long containing  the data (just repeated level numbers in this example)

 

is it possible to get this?



#109 snicklin OFFLINE  

snicklin

    River Patroller

  • 2,209 posts
  • Location:Australia

Posted Sun Jan 6, 2019 5:42 AM

@matosimi I was just wondering why you want MADS to do this? To me this seems like something that your local machine should be doing on the command line or with Perl / Python etc? Then you'd just load those files into your program to show with the Atari.



#110 Sheddy ONLINE  

Sheddy

    Dragonstomper

  • 772 posts
  • Location:UK

Posted Sun Jan 6, 2019 5:53 AM

I don't think mads is the right thing for what you want unless I'm misunderstanding. Get and put are done at assembly time, not runtime?
Something like the exomizer compressor might be worth looking at. There is a level compressor which can stream to a circular buffer, although the example decrunch code is not up to date and it looks quite daunting to me.

#111 matosimi OFFLINE  

matosimi

    Moonsweeper

  • 354 posts
  • Location:Slovakia - Bratislava http://matosimi.atari.org

Posted Sun Jan 6, 2019 10:02 AM

@matosimi I was just wondering why you want MADS to do this? To me this seems like something that your local machine should be doing on the command line or with Perl / Python etc? Then you'd just load those files into your program to show with the Atari.

I'm using php for some data file conversions, I like python but there is a reason why I used php.
I'm working on one game conversion and the original game itself is disk-based and the data are incompatible, so I need to rewrite all loading routines and at the same time I have to retain all the data packed in the memory and unroll only those parts that are needed at the specific level.
 
all leveldata are in 4 assembly files each of which which consists of 5 data blocks of same size. I'm looking for some ellegant way to build the data (several DTA lines) w/o need to split each datablock source in 1 single file which would eventually result in 20 source files where each would need to be assembled to get 20 obx files and then strip the atari data block header and get 20 "bin" files.
I thought I would be able to do this with single MADS source file.
I want to avoid manual actions when building the game, I would like to get some batch file that could execute all actions which will finally end up in single obx(xex) file.
 
 

I don't think mads is the right thing for what you want unless I'm misunderstanding. Get and put are done at assembly time, not runtime?
Something like the exomizer compressor might be worth looking at. There is a level compressor which can stream to a circular buffer, although the example decrunch code is not up to date and it looks quite daunting to me.

 
.get, .put, .sav are handled at assembly time.
You can load binary file using .get, then you can perform some data transformation with .get/.put in .rept loop and afterwards you can materialize (insert) the final data to your binary output using .sav.
 
...
It seems the correct workaround will be to put all 20 data blocks in one asm source file and assemble it to single obx file... which will then be beheaded :) and cut into 20 pieces by php/python script.
 


Edited by matosimi, Sun Jan 6, 2019 10:08 AM.


#112 VladR OFFLINE  

VladR

    Stargunner

  • 1,577 posts
  • Location:Montana

Posted Mon Jan 7, 2019 3:30 AM

@matosimi I was just wondering why you want MADS to do this? To me this seems like something that your local machine should be doing on the command line or with Perl / Python etc? Then you'd just load those files into your program to show with the Atari.

Exactly. For all my Jaguar-related work, I always keep a Visual Studio open and use .NET for all the conversions and parsing and exports into the format that the assembler accepts.

 

I found that Python sucks when it comes to debugging (honestly, anything does, when compared with VS debugger), so the time I gain by writing the script in command line is more than just lost the moment I need to figure out what the hell is going on.

 

Also, in case of a crash, you automatically get a nice full stack trace (totally beats the Python trace), so you see it right there, what happened, without even having to debug it most of the time.

 

 

While Python is OK I that regard, I personally can't recommend Perl, as I find Perl to be write-only code, whereas C# is instantly readable even after a year.



#113 tebe OFFLINE  

tebe

    Dragonstomper

  • 792 posts
  • Location:Poland

Posted Wed Jan 9, 2019 4:21 PM

mads 2.0.8

 

http://mads.atari8.info

 
- .LONGA ON|OFF, .LONGI ON|OFF (65816)
- '-FV:VALUE', fill value for 'OPT F+'
-  lda #'AB' (65816) ; mwa #'XY' $80 (6502, 65816)

example (FPU - Marco Granati)

 

fpu_x65816 - Avocet X65816 (original)

fpu_mads (conversion)

Attached Files


Edited by tebe, Wed Jan 9, 2019 4:26 PM.


#114 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,846 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Wed Jan 9, 2019 5:25 PM

 '-FV:VALUE', fill value for 'OPT F+

 

Rulez!



#115 JAC! OFFLINE  

JAC!

    Stargunner

  • 1,846 posts
  • Always looking for GFX and MSX for my demos
  • Location:Lebach, Germany

Posted Wed Jan 9, 2019 5:41 PM

,,,then strip the atari data block header and get 20 "bin" files.

 

..It seems the correct workaround will be to put all 20 data blocks in one asm source file and assemble it to single obx file... which will then be beheaded :) and cut into 20 pieces by php/python script.

 

I want to avoid manual actions when building the game, I would like to get some batch file that could execute all actions which will finally end up in single obx(xex) file.

 

I don't really understand why you would want 20 separate files (maybe for separate compression), but you can deactivate the header in any case with "OPT h-", so you don't need to strip it. I and always have the cygwin tools installed, so I can use a command like "split.exe" in the batch file. I use batch files makefiles for all more complex projects and I also use multiple MADS stages, DIR2ATR and AtariRomMaker, often.

echo Creating disk image.
set ATR=%RELEASE%.atr
atr\hias\dir2atr.exe -d -m -b MyDos4534 %ATR% atr\files
if ERRORLEVEL 1 goto :dir2atr_error
echo Done.

:make
cd asm
echo Compiling menu.
set EXECUTABLE=..\atr\files\%1
if exist %EXECUTABLE% del %EXECUTABLE% 
%MADS% -s SillyMenu.asm -o:SillyMenu.xex %2 %3
if ERRORLEVEL 1 goto :mads_error
echo Packing menu.
%EXOMIZER% sfx $2000 SillyMenu.xex -t 168 -o SillyMenu-Packed.xex -q
echo Compiling loader.
%MADS% -s SillyMenu-Loader.asm -l -o:%EXECUTABLE% %2 %3
if ERRORLEVEL 1 goto :mads_error
dir SillyMenu.xex %EXECUTABLE% 


#116 tebe OFFLINE  

tebe

    Dragonstomper

  • 792 posts
  • Location:Poland

Posted Sun Jan 13, 2019 12:56 PM

mads 2.0.9 build 2

 

.CBM 'TEXT'   convert ASCII to COMMODORE screen code

 

example: IceBloxPlus (C64)

 

http://www.javaonthe...us/devices.html

 

 

Attached Files






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users