Jump to content

Photo

Catharsis Theory - a new 4k demo

demo 4k source

39 replies to this topic

#26 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 22,445 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Apr 20, 2017 7:32 AM

Ah, I remember that from somewhere...

 

My version: DASM 2.20.11 unofficial RevEng 20140124


Edited by Thomas Jentzsch, Thu Apr 20, 2017 7:57 AM.


#27 enthusi OFFLINE  

enthusi

    Moonsweeper

  • 313 posts
  • Location:Potsdam, Germany

Posted Thu Apr 20, 2017 7:49 AM

haha, hehe.. *cries*

 

I seriously wonder why so many people in the Atari field keep using DASM.

Or in fact it appears to me that many individual patches/fixes are out there.

All other 6502-based communities use other or at least a large variety of assemblers.

 

Funny, somehow.



#28 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 22,445 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Apr 20, 2017 7:57 AM

Historical reasons I suppose.



#29 Kylearan OFFLINE  

Kylearan

    Chopper Commander

  • Topic Starter
  • 192 posts

Posted Thu Apr 20, 2017 8:01 AM

I seriously wonder why so many people in the Atari field keep using DASM.
[...]
All other 6502-based communities use other or at least a large variety of assemblers.


Can you recommend a better alternative? You'd instantly become my personal hero! :D

Apart from a lot of minor gripes I have with dasm, the main feature I'm looking for is to have a linker where I can mark sections as aligned or parts of a section as "nocross" (i.e. that part must not cross a page boundary) and then let the linker optimize placement in ROM.

KK's k65 more or less has such a linker, but it doesn't use standard 650x mnemonics and has lots of other minor annoyances and inconsistencies.

#30 enthusi OFFLINE  

enthusi

    Moonsweeper

  • 313 posts
  • Location:Potsdam, Germany

Posted Thu Apr 20, 2017 8:07 AM

I use XA from floodgap which is pretty basic and I like that plus it comes with a suitable disassembler.

Ca65 of the cc65 suite is pretty popular among sceners with a background as professional programmers.

Kickassembler is pretty mighty (which I dislike ;-)

Then there is K2asm that provides inline-Python for those are into such things.

To replace DASM probably ACME is a good choice as well. Still actively developed.

 

Me, I like it simple. I only use local labels and #defines as a 'feature' of XA, not even macros (which it has).

Converting my source to-from any other is no issue.



#31 Kylearan OFFLINE  

Kylearan

    Chopper Commander

  • Topic Starter
  • 192 posts

Posted Thu Apr 20, 2017 8:27 AM

From a quick glance over the assemblers you listed, none of them seems to support the "nocross" declaration in conjunction with a linker. Which is really odd, as that is often needed and would be much more powerful and easier to use than manually fiddling around with "align" and "org" statements.

#32 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 22,445 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Apr 20, 2017 8:30 AM

Macros can help here.



#33 gauauu OFFLINE  

gauauu

    Moonsweeper

  • 268 posts
  • Location:Illinois

Posted Thu Apr 20, 2017 9:20 AM

 

 

I seriously wonder why so many people in the Atari field keep using DASM.

 

 

Part of it is that it's just easier to use the same thing others are using.  Then as you pass around code, or ask questions, everyone knows what you're talking about.

 

 

 

Ca65 of the cc65 suite is pretty popular among sceners with a background as professional programmers.

 

 

I've been using ca65 for a nes game recently.  It's pretty nice, but learning the linker configuration system can be a pain.



#34 enthusi OFFLINE  

enthusi

    Moonsweeper

  • 313 posts
  • Location:Potsdam, Germany

Posted Fri Apr 21, 2017 2:29 AM

I've been using ca65 for a nes game recently.  It's pretty nice, but learning the linker configuration system can be a pain.

Yes, it's not my cup of coffee either :) As I said people who are used to this from i.e. embedded coding etc. seem to love it :-)

I for one want to keep 100% control of all bytes. Which is also why I dont like macros and alike. If something is supposed to be in memory, I want to have written that manually ;-)

Not particularly efficient but this is  my hobby and that is why I enjoy Assembler coding - not for rapid application development but handwritten opcodes and knowledge where in ZP which variable sits, etc.

I align by

.dsb $1000-*,$ff if I already know the barrier or even:

.dsb ((*+$100)/$100)*$100-*,$ff to align for the next best page break.

There is no branches-crossing-page-boundaries warning in XA but sometimes I write python tools to check labels as postprocess.



#35 Kylearan OFFLINE  

Kylearan

    Chopper Commander

  • Topic Starter
  • 192 posts

Posted Fri Apr 21, 2017 3:46 AM

I understand your point of view; it's a matter of taste. I however would like to concentrate on coding actual effects or game logic. Manually aligning code and data, sometimes with a needed offset, and manually searching for code caves when ROM gets full and then shuffling around routines and data blocks is something I've done extensively before and already know how that works. Now the computer scientist in me demands that my PC should do that chore for me. It's an optimization problem perfectly suited to computers, so it can do it better anyway! :)

So I broke down and actually started to develop my own assembler/linker. It will support align with offset and nocross sections, optimize placement of sections in ROM and yet still allows full control of everything, if needed. It also does away with stupid white space rules and other annoyances. Hopefully with Boost Spirit it won't take very long to have a usable prototype.

#36 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 22,445 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Fri Apr 21, 2017 4:05 AM

I almost forgot, here is the working ROM (for those who are too lazy to assemble it themselves icon_wink.gif).

 

BTW: @Kylearan: I noticed your random number generation. Why don't you use LFSRs?

 

Attached Files



#37 Kylearan OFFLINE  

Kylearan

    Chopper Commander

  • Topic Starter
  • 192 posts

Posted Fri Apr 21, 2017 4:46 AM

BTW: @Kylearan: I noticed your random number generation. Why don't you use LFSRs?


To be honest, I just googled for 8 bit pRNG routines and quickly found one at codebase64 which is small and generates all numbers between 0-255 (which for some effects like fades is useful), so I didn't search any further. So far, it served me well on multiple occasions, and up to now I only needed 256 different seeds and not a 16 bit version.

 

But from a quick glance at your link it seems to be very similar in concept, and "my" version also allows any seed, even 0 (which is quite important).


Edited by Kylearan, Fri Apr 21, 2017 4:47 AM.


#38 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 11,141 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Fri Apr 21, 2017 6:45 AM

I for one want to keep 100% control of all bytes. Which is also why I dont like macros and alike.
...
 
There is no branches-crossing-page-boundaries warning in XA but sometimes I write python tools to check labels as postprocess.

 
 
Might be worth making an exception if you can create a macro for XA like this set we use with dasm. You still maintain 100% control of the bytes, it just generates an error as part of the compile process:
 
;-------------------------------------------------------
; SAME PAGE BRANCH CHECK
; Original auther: John Payson
;
; Usage: sbeq, sbne, etc just like a normal beq, bne, etc.
;        A message will be output if the target of the branch
;        is not on the same page.
;
            mac sbcc
                bcc     {1}
                if (* ^ {1}) & $FF00
                echo "PAGE CROSSING","WARNING ",{1}," at ",*
                err
                endif
            endm
 
            mac sbcs
                bcs     {1}
                if (* ^ {1}) & $FF00
                echo "PAGE CROSSING","WARNING ",{1}," at ",*
                err
                endif
            endm
 
            mac sbeq
                beq     {1}
                if (* ^ {1}) & $FF00
                echo "PAGE CROSSING","WARNING ",{1}," at ",*
                err
                endif
            endm
 
            mac sbmi
                bmi     {1}
                if (* ^ {1}) & $FF00
                echo "PAGE CROSSING","WARNING ",{1}," at ",*
                err
                endif
            endm
 
            mac sbne
                bne     {1}
                if (* ^ {1}) & $FF00
                echo "PAGE CROSSING","WARNING ",{1}," at ",*
                err
                endif
            endm
 
            mac sbpl
                bpl     {1}
                if (* ^ {1}) & $FF00
                echo "PAGE CROSSING","WARNING ",{1}," at ",*
                err
                endif
            endm
 
            mac sbvc
                bvc     {1}
                if (* ^ {1}) & $FF00
                echo "PAGE CROSSING","WARNING ",{1}," at ",*
                err
                endif
            endm
 
            mac sbvs
                bvs     {1}
                if (* ^ {1}) & $FF00
                echo "PAGE CROSSING","WARNING ",{1}," at ",*
                err
                endif
            endm
 
I made a variation set of them as dXXX to confirm branch to a different page as I needed the extra cycle to occur one time.
;-------------------------------------------------------
; DIFFERENT PAGE BRANCH CHECK
; Original auther: Darrell Spice, Jr.
;
; Usage: dbeq, dbne, etc just like a normal beq, bne, etc.
;        A message will be output if the target of the branch
;        is not on a different page.
;
            mac dbcc
                bcc     {1}
                if ((* ^ {1}) & $FF00) = 0
                echo "SAME PAGE","WARNING ",{1}," at ",*
                err
                endif
            endm

            mac dbcs
                bcs     {1}
                if ((* ^ {1}) & $FF00) = 0
                echo "SAME PAGE","WARNING ",{1}," at ",*
                err
                endif
            endm

            mac dbeq
                beq     {1}
                if ((* ^ {1}) & $FF00) = 0
                echo "SAME PAGE","WARNING ",{1}," at ",*
                err
                endif
            endm

            mac dbmi
                bmi     {1}
                if ((* ^ {1}) & $FF00) = 0
                echo "SAME PAGE","WARNING ",{1}," at ",*
                err
                endif
            endm

            mac dbne
                bne     {1}
                if ((* ^ {1}) & $FF00) = 0
                echo "SAME PAGE","WARNING ",{1}," at ",*
                err
                endif
            endm

            mac dbpl
                bpl     {1}
                if ((* ^ {1}) & $FF00) = 0
                echo "SAME PAGE","WARNING ",{1}," at ",*
                err
                endif
            endm

            mac dbvc
                bvc     {1}
                if ((* ^ {1}) & $FF00) = 0
                echo "SAME PAGE","WARNING ",{1}," at ",*
                err
                endif
            endm

            mac dbvs
                bvs     {1}
                if ((* ^ {1}) & $FF00) = 0
                echo "SAME PAGE","WARNING ",{1}," at ",*
                err
                endif
            endm


#39 enthusi OFFLINE  

enthusi

    Moonsweeper

  • 313 posts
  • Location:Potsdam, Germany

Posted Fri Apr 21, 2017 7:30 AM

Oh, admittedly that is a nice solution but it affects the source code.

Two things mentioned here I also had in mind ;-)

 

"optimize placement of sections in ROM" while you follow the smart approach I once wrote a python code to do that based on labels that are local with start, end and then tries to re-arrange them for best continuous fit.

For Assembloids2600 I did all by hand. Back and forth. Alot. Again. Alot. Lost my sanity several times ;-)

 

And about branching, I'd rather patch the assembler code itself to check for that if the branch lines contains a ";nocross" instead of using an artificial opcode.

Then again, your version works, mine is just a 'what if' in my head ;-)



#40 gauauu OFFLINE  

gauauu

    Moonsweeper

  • 268 posts
  • Location:Illinois

Posted Fri Apr 21, 2017 11:19 PM

 

"optimize placement of sections in ROM" while you follow the smart approach I once wrote a python code to do that based on labels that are local with start, end and then tries to re-arrange them for best continuous fit.

For Assembloids2600 I did all by hand. Back and forth. Alot. Again. Alot. Lost my sanity several times ;-)

 

 

Ugh, I wasted so much time doing that at the end of my Atari Anguna development. I don't want to have to do that ever again, I'm all for a tool that makes it easier.  (That said, a lot of it was also rearranging between banks, which is a bit more complicated, as you have to also track what data each section has access to, and factor in the expense of doing a bank jump) 







Also tagged with one or more of these keywords: demo, 4k, source

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users