Jump to content
IGNORED

Pretty printer / formatter for CP1610 assembler code


Recommended Posts

Hi all.

 

Today I got the idea of tinkering with pretty6502 my pretty printer / formatter for 6502 source code and I thought it would be nice to do same for CP1610 assembler code (the processor used in Intellivision)

 

Typically I dismiss formatting when developing a game because I want to finish fast :) so this utility really helps :)

 

Enjoy it!

 

Download URL for pretty6502 v0.4 https://github.com/nanochess/pretty6502/releases

 

Sample of code before formatting (from Princess Quest): (BTW the left side had Tab and space mix/match causing horizontal deviation in TextEdit but for some reason it doesn't happen here)

 

	;
	; Se prepara para secuencia de victoria
	;
        CALL secuencia_final
        MVII #victoria_1,R0
	MVII #$0218,R1
	MVII #$0c,R2
	CALL copia_pantalla
        MVII #victoria_2,R0
	MVII #$022c,R1
	MVII #$0c,R2
	CALL copia_pantalla
	MVII #300,R0
@@5:    PSHR R0
        CALL actualiza_sprites
        CALL espera_cuadro
        CALL mueve_monigotes
        PULR R0
        DECR R0
        BNE @@5
        MVII #victoria_3,R0
	MVII #$0253,R1
	MVII #$0e,R2
	CALL copia_pantalla
	MVII #500,R0
@@15:   PSHR R0
        CALL espera_cuadro
        PULR R0
        DECR R0
        BNE @@15
After pretty printing it:

 

        ;
        ; Se prepara para secuencia de victoria
        ;
        CALL    secuencia_final
        MVII    #victoria_1,R0
        MVII    #$0218,R1
        MVII    #$0c,R2
        CALL    copia_pantalla
        MVII    #victoria_2,R0
        MVII    #$022c,R1
        MVII    #$0c,R2
        CALL    copia_pantalla
        MVII    #300,R0
@@5:    PSHR    R0
        CALL    actualiza_sprites
        CALL    espera_cuadro
        CALL    mueve_monigotes
        PULR    R0
        DECR    R0
        BNE     @@5
        MVII    #victoria_3,R0
        MVII    #$0253,R1
        MVII    #$0e,R2
        CALL    copia_pantalla
        MVII    #500,R0
@@15:   PSHR    R0
        CALL    espera_cuadro
        PULR    R0
        DECR    R0
        BNE     @@15
There are several options for formatting available, trying to fit all styles ;)
  • Like 1
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...
 Share

  • Recently Browsing   0 members

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