Videopac / Odyssey2 forum
November 20, 2019, 05:22:19 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: If you have some news and you want it to be shown here, pm Janzl!
 
   Home   arcade Help Login Register links videopac.nl  
Pages: [1]   Go Down
  Print  
Author Topic: How to turn the screen to black upon reset  (Read 4920 times)
Chris!
Give this man a Jopac!
******
Posts: 1145



WWW
« on: May 22, 2017, 08:46:39 AM »

So I'm using this code to color the screen with:
Code:
vsync
stop tcnt
;mov r0,#000h ; (first color: I used black/black here, to keep SELECT GAME screen black)
;mov a,#0a3h
movx @r0,a
mov a,#0ffh ; (Hereīs the size. FF is the smallest trace, the same size of a horizontal bar, at this size it will not visible on screen)
mov t,a
strt cnt
jmp 001ah

timer
sel rb0
mov r5,a ; save accumulator
stop tcnt
mov r0,#030h ; get color data pointer
mov a,@r0
add a,#colordata & 0ffh ; get color data address
mov r2,a
movp a,@a ; get color
mov r1,#0a3h
waitline1
jt1 waitline1 ; wait for end of video line
waitline2
jnt1 waitline2
movx @r1,a ; set color
inc @r0 ; update data pointer
inc r2
mov a,r2
movp a,@a ; get timer data
mov t,a
strt cnt ; start timer
inc @r0 ; update data pointer
inc r2
mov a,r2 ; check if next data = 0
movp a,@a
jnz timerend
mov @r0,a ; reset pointer if end of data
stop tcnt
timerend
mov a,r5 ; restore accumulator
retr

colordata:   ;(2nd color) (itīs size)   (3rdcolor) (itīs size)    ...

   db 01ah,      0e9h,        01ah,          0ech,       01ah,0fdh,01ah,0c0h
  db 01ah,0fah,01bh,0dbh,011h,0d6h,009h,0feh,009h,0feh,000h ;(use 000h to close)
But whenever the game resets, it resets to what should be at the beginning, but not on a black background, it displays the background colors that were in the game. I noticed when I reset the game with the reset button, it went to a black background. So my question is how do I reset the game and have a black background?
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Rene_G7400
Moderator
I take the Videopac and leave the Canoli!
*****
Posts: 2519



WWW
« Reply #1 on: May 22, 2017, 09:33:12 AM »

When you reset the game you need to disable the timer interrupts with DIS TCNTI.
Logged
Chris!
Give this man a Jopac!
******
Posts: 1145



WWW
« Reply #2 on: May 22, 2017, 09:39:03 AM »

That worked! Thank you so much!
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Chris!
Give this man a Jopac!
******
Posts: 1145



WWW
« Reply #3 on: May 22, 2017, 10:51:52 AM »

OK, I'm making an 8k game. If I die in a different bank, it shows the colors of that bank regardless of where I put "dis tcnti." Not only that, it shows the sprites as well. What should I do?
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Chris!
Give this man a Jopac!
******
Posts: 1145



WWW
« Reply #4 on: May 22, 2017, 10:56:34 AM »

Never mind, I figured it out.
Logged

All my Odyssey2 projects, now in one place!
http://www.atari2600land.com/odyssey2.html
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!