namco Posted March 28, 2019 Share Posted March 28, 2019 (edited) I'm trying to program a moving line effect that I seem to have gotten working thanks to Vide but opening it in Para JVE just draws the line as is rather than in the below example: Vide: https://video.twimg.com/tweet_video/D2uyeyeW0AAMpq4.mp4 Code used + Para JVE screenshot: https://t.co/BQoHme98Uc Would the code I wrote work on a Vectrex like Vide or like Para JVE? [Edit]: I've also noticed that the moving line code I wrote reaches the end of the screen just after the intro bit ends i.e. instead of intro then moving line goes from 2 to the end of the screen, the moving line is already near the end of the screen after the intro. So how would I delay the moving line code from running until after the intro sequence ends? Thanks. Edited March 28, 2019 by namco Quote Link to comment Share on other sites More sharing options...
Malban Posted March 28, 2019 Share Posted March 28, 2019 (edited) I typed in your code (would have been nicer with a copy and paste!). And it works both in Vide and ParaJVE alike. But you do not provide enough information! The code cannot be fully seen, dunno where/how you defined "Line_test". Line_test should be in RAM (which I assumed), if you put it into ROM, and enabled Vide to write to ROM, than that would explain the difference. Also - I don't see where you initialize the variable - I guess the answer to that question might lead to the answer of your [edit] question. Also also, I think the proboard forum would be a better place to discuss vectrex coding. Regards Edited March 28, 2019 by Malban Quote Link to comment Share on other sites More sharing options...
namco Posted March 29, 2019 Author Share Posted March 29, 2019 I either provide too much code or too little! XD Anyway, here's the full listing: Intensity_1F equ $f29d Intensity_3F equ $f2a1 Intensity_5F equ $f2a5 Moveto_d equ $f312 VIA_t1_cnt_lo equ $d004 Draw_line_d equ $f3df Wait_recal equ $f192 music1 equ $fd0d Vec_Misc_Count equ $c823 Delay_3 equ $f56d Delay_b equ $f57a Line_test equ 2 org 0 ; intro information start db "g GCE 2019",$80 ; g is a copyright sign ; above MUST start with "g CGE" otherwise it'll just run Minestorm ; $80 is a string terminator and lower case is for special characters. ; Uppercase only. dw music1 ; Pointer to a music structure db $f2,$30,$20,-$15 ; height, width, rel y, rel x (from 0,0) of following string db "OAOA",$80 ; string format set by above line db 0 ; game header finish ; intro information end main: jsr Wait_recal ; Vectrex BIOS recalibration ;lda #$80 ;sta VIA_t1_cnt_lo ; Both needed before drawing ; must set relative position from Wait_recal as cannot use that straight off lda #00 ; set y position ldb #00 ; set x position jsr Moveto_d ; move beam to relative position (from this point it's set at 0,0 due to Wait_recal) jsr Intensity_3F ; set beam intensity to 3F lda #00 ldb Line_test incb stb Line_test jsr Draw_line_d ldb #00 ;delay: ; incb ; cmpb #255 ; bne delay bra main end main Quote Link to comment Share on other sites More sharing options...
Malban Posted March 29, 2019 Share Posted March 29, 2019 Well. More or less as I thought. Please read (perhaps again?) my documentation at: http://vide.malban.de/ under the help section, especially the "RAM" thingy (accessed thru the menu). Line_test equ 2 Places the "Variable" Line_test into the ROM section - actually on the letter "G" (memory address 2) - it should be placed somewhere above $c880 (RAM). The only way to make that work in Vide, is when you enable "write" to ROM. (not sure - perhaps ParaJVE has a switch to allow that too) (Which I implemented for different reasons - and should under any normal circumstances be switched off, additionally - the usual Vide distribution (unless I have forgotten it), sets an automatic breakpoint if you try to write to ROM, didn't you get some kind of warning - jump to debugger at some point?). Originaly the EQU (pseudo opcode) statement was ment to define CONSTANTS not labels and not "variables". The usage to define constant labels like the BIOS locations is simply done because the code of the ROM as source is not available at that point. And the assembler interprets every "number" (even constants, or labels or names) as addresses. Labels should best be defined in the code/ram section of your program. To be utterly clear - Line_test in your context is NOT a variable (in a assembler there are no "variables" - there are always only addresses with additional "meaning") in that sense, but a constant with the value of "2". If you write lda #Line_test Than register A will have "2" as a content. If you write lda Line_test register A will have "G" ($41) as content, because Line_test points to memory address 2, which reads "g GCE"... ( the "G"). Regards Malban Quote Link to comment Share on other sites More sharing options...
namco Posted March 30, 2019 Author Share Posted March 30, 2019 It works now! https://twitter.com/namco_/status/1111994920024313856 I removed the equ and put the Line_test in RAM space! Thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.