Welp, in short - its a line drawing routine for my 3D program that I'm working on. I did one a few years ago on the C-64 based on a C routine from a 3D game programming book...coupled with Mr. Butterfield's pixel plotter routine found in a Compute's Gazette mag.
The one I'm working on now - should be much faster using tables and the line drawing routine is already worked out in ML - just have to type it all in and get the bugs out...
Hires Graphics
Moderator: Moderators
Hi Mike,
first of all my deep respect for your programs and BASIC scripts!
I’ve read this thread and I’d love to have commented sources of MINIGRAFIK! Especially the @CLR, @RETURN, @LOAD and @SAVE parts (@ON was described in this thread earlier).
I’m asking for learning purposes and eventually using that graphic mode and knowledge in a game.
first of all my deep respect for your programs and BASIC scripts!
I’ve read this thread and I’d love to have commented sources of MINIGRAFIK! Especially the @CLR, @RETURN, @LOAD and @SAVE parts (@ON was described in this thread earlier).
I’m asking for learning purposes and eventually using that graphic mode and knowledge in a game.
8-bit assimilation
- Mike
- Herr VC
- Posts: 4849
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Hi, lordbubsy,
it's rather strange to see this thread revived after nearly 4 years.
@CLR is also quite simple, the bitmap is cleared with a loop and the colour RAM is initialised with the value in $0286:
The subroutines of @LOAD and @SAVE call a routine in the BASIC interpreter to fetch the filename and device number from the running BASIC program, which makes it difficult to use them unaltered in the context of another ML program. I can provide stand-alone versions of these two, but even MINIPAINT takes a simpler route: the editor code just drops to BASIC and then executes @LOAD and @SAVE from there.
Greetings,
Michael
it's rather strange to see this thread revived after nearly 4 years.
@RETURN is rather easy, it just calls $E518 to reset the VIC registers and initialise the screen editor.lordbubsy wrote:I’ve read this thread and I’d love to have commented sources of MINIGRAFIK! Especially the @CLR, @RETURN, @LOAD and @SAVE parts ([...])
@CLR is also quite simple, the bitmap is cleared with a loop and the colour RAM is initialised with the value in $0286:
Code: Select all
.Clr
LDA #$11 ; put start of bitmap ($1100) into pointer in ZP
STA $FC
LDA #$00
STA $FB
TAY
LDX #$0F ; clear 15 pages
.Clr_00
STA ($FB),Y
INY
BNE Clr_00
INC $FC
DEX
BNE Clr_00
LDA $0286 ; load foreground colour
.Clr_01
STA $9400,Y ; init the first page of colour RAM
INY ; (actually, clearing just 240 bytes would be
BNE Clr_01 ; enough, but no harm doing 256.)
RTS
Greetings,
Michael
Well I read a lot of the old threads using the forum search. Let me know if it’s better for the forum to make new threads.Mike wrote:it's rather strange to see this thread revived after nearly 4 years.
I’m interested in BASIC extensions and one of my ongoing projects for the C64 and now also for the VIC-20, is to collect (and try to understand) sources of BASIC commands like DEL, AUTO, FIND, RENUM, LIN, MERGE, OLD, HELP, MEM, KILL, CLS, CURSOR, BSAVE, BLOAD, DUMP, PAUSE etc.
I use them as little utilities, for instance at $33C or in a custom BASIC extension.
So essentially@RETURN is rather easy, it just calls $E518 to reset the VIC registers and initialise the screen editor.
Code: Select all
JSR $E518
JMP $C474 ;restart basic, print ready, set direct mode
OK, that’s 100% clear.@CLR is also quite simple, the bitmap is cleared with a loop and the colour RAM is initialised with the value in $0286:
I guess because of setting up the complete file structure.@LOAD and @SAVE use a lot of calls into the BASIC interpreter and in their current form it would be difficult to incorporate them into another program
Well, actually I am.If you're interested I can provide stand-alone versions of these two, so they can be called from other ML code
I didn’t find any good sources for them. At least for the VIC.
So that would be great!
8-bit assimilation
Thank you for the source and help!
It resulted in a stand-alone display routine for own purposes. (like a game etc.)
The source can be assembled with ACME
http://www.esw-heim.tu-clausthal.de/~ma ... brod/acme/
http://codebase64.org/doku.php?id=base:crossdev
Picture and loader has to be in the same directory.
The program has to be loaded with ,8,1 and started with “SYS8888
It resulted in a stand-alone display routine for own purposes. (like a game etc.)
The source can be assembled with ACME
http://www.esw-heim.tu-clausthal.de/~ma ... brod/acme/
http://codebase64.org/doku.php?id=base:crossdev
Picture and loader has to be in the same directory.
The program has to be loaded with ,8,1 and started with “SYS8888
8-bit assimilation
- Mike
- Herr VC
- Posts: 4849
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Just a small remark about this section:
MINIGRAFIK saves the contents of VIC register $900E (auxiliary colour and volume) with the bottom nibble zeroed out. When a picture is loaded again, these four instructions then serve to keep the current volume setting.
The original code in MINIGRAFIK and in its executable pictures does a slightly more elaborate:lordbubsy wrote:Code: Select all
[...] lda $10fe sta $900e [...]
Code: Select all
LDA $900E
AND #$0F
ORA $10FE
STA $900E