Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
34 user(s) are online (21 user(s) are browsing Forums)

Members: 0
Guests: 34

more...

Headlines

Forum Index


Board index » All Posts (saimo)




Re: SkillGrid - new AGA game in the works
Quite a regular
Quite a regular


Just released SkillGrid v1.4.
This update originally was meant to just improve the startup code, but testing the game inspired new ideas and also uncovered some flaws never seen before, so it ended up being quite substantial and brings SkillGrid to yet another level.

https://retream.itch.io/skillgrid

Longplay video showing me setting a new personal record (when playing with the keyboard, that is - this game is meant to be played with a joystick!) - and putting an end to the effort with a beginner mistake: https://www.youtube.com/watch?v=3DijdKgRfsA

Changelog

v1.4 (6.1.2024)
1. Added cells field flashing when these cells (are about to) appear:
* ASTEROIDS cell (bright colors);
* BEAM/* cells, if their exit from the bottom of the screen would reduce the number of beams shot by the spaceship (bright colors);
* MOTHERSHIP, MUSIC MODE, SKULL (same colors of the cells field when the associated boss/mode is active).
2. Made the spaceship flash red when its shield is low.
3. Made the spaceship glow red for half a second when its shield gets damaged.
4. Made the middle layer appear progressively at the beginning of a game.
5. Made the cells layer populate with empty cells progressively.
6. Changed a few pixels of the title screen spaceship icon and of the Skull.
7. Improved the handling of audio channels.
8. Made sure no sprite tearing occurs when switching between screens.
9. Made sure that the system MMU setup does not interfere.
10. Fixed crash when a tune was started while another tune was playing (e.g. when the MUSIC MODE cell was caught while missiles were active).
11. Fixed the stopping of the music mode music (it inhibited the restart of the spaceship afterburner sound).
12. Fixed the X position of specifically-requested cells (it was equal to the type of the cell removed at the same time).
13. Fixed the lengths of some sounds samples (they were odd).
14. Made various speed and memory optimizations.
15. Made the startup and cleanup code more robust.
16. Worked on the cells:
* improved the handling of the TURN cell (now it is randomized and it ensures that the speeds of the UFOs will always change);
* increased the frequency of the MUSIC MODE cells;
* decoupled the randomization of the cells types and positions;
* created the BOSSES (virtual) class of cells, grouping the BOLTSPITTER and SKULL cells (previously MALUSES) and the MOTHERSHIP cell (previously UNDEFINED) into it;
* made the template of the BOLTSPITTER and SKULL cells striped;
* made the template of the TURN cell fringed;
* made the template of the BEAM/DOUBLE cell equal to that of the other BEAM/* cells.
17. Worked on the audio channels allocation priorities of the sound effects:
* given the Boltspitter bolt shooting and the hitting of the spaceship by the Mothership beam priority over the milestone notification;
* assigned the speech warnings specific priorities (from lowest to highest: "charge low", "shield low", "approaching asteroids", "escapes critical", "danger", "time running out").
18. Updated/improved the documentation.
19. Updated the artwork to reflect the new cells graphics.


Edited by saimo on 2024/1/6 20:13:29
RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: Demo THE CURE
Quite a regular
Quite a regular


Just released a little update. This should cure (heh) the stuttering I've seen on some boards that are more than capable of running the demo at full speed.

https://retream.itch.io/the-cure

v1.5 (2.1.2024)
* Improved CPU data cache handling on 68040 and 68060.
* Ensured the system MMU setup does not affect performance.
* Ensured the 68060 susperscalar dispatch is enabled.
* Made some small optimizations.
* Made startup and cleanup code more robust.

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: PED81C - pseudo-native, no C2P chunky screens for AGA
Quite a regular
Quite a regular


Just released a new version of PVE. Full changelog below. In short: it's faster and it's got a few little additions.

https://retream.itch.io/ped81c

v1.1 (22.12.2023)
* Reworked screen buffering, so that the raster data is more efficiently written to CHIP RAM when bitplanes DMA is inactive.
* Improved 68030 caches handling.
* Added 68040 and 68060 caches handling.
* Added MMU handling to avoid that the MMU affects the speed negatively.
* Optimized rendering core by making it write the dots sequentially.
* Made a little 68060-specific code optimization.
* Ensured 68060 susperscalar dispatch is enabled.
* Added live-toggable staggered lines video filter, which helps see better colors on devices that do not support SHRES and reduces the jailbars effect on devices that support SHRES (to enable/disable: [F1]).
* Made fps indicator live-togglable (to enable/disable: [F2]).
* Made quitting from the voxel screen return to the splash screen.
* Replaced mouse controls with keyboard controls.
* Added benchmark function.
* Added command line switches to control the CPU caches.
* Fixed bug that caused a longword to be written to a random location when the fps indicator was on.
* Fixed an innocuous initialization bug.
* Made cleanup code more robust.
* Updated, extended and fixed documentation.

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@all

Once again thanks for having chosen Blastaway, for the partecipation to the compo and also for the extra purchases!

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: PED81C - pseudo-native, no C2P chunky screens for AGA
Quite a regular
Quite a regular


I have just released a little update, accompanied by the PED81C Voxel Engine (PVE), i.e. a new demo. If you can't be bothered trying it yourself, you can see it in this video - but beware: YouTube's video compression degraded the visual quality (especially the colors saturation and brightness).





Details about PVE straight from the manual:
--------------------------------------------------------------------------------
OVERVIEW

PVE is an experiment to test the graphical quality 
and computational performance
of the PED81C system
It allows to move freely around a typical voxel landscape.


--------------------------------------------------------------------------------
GETTING STARTED

PVE requires
:
 * 
Amiga computer
 
AGA chipset
 
200 kB of CHIP RAM
 
4 MB of FAST RAM
 
PAL SHRES support
 
digital joystick/joypad and mouse
 
2.1 MB of storage space

If the monitor graphics card scan doubler do(esnot support SHRESthe
colors will look off 
or even not show at all.
For 
example:
 * 
MNT's VA2000 graphics card displays only the even columns of pixels, so only
   reds and blues show;
 * Irix Labs' 
ScanPlus AGA displays only the odd columns of pixels (contrary to
   how is was originally marketed
), so only greens and grays show.

To install PVEunpack the LhA archive to any directory of your choice.

To start PVEopen the program directory and double-click the program icon from
Workbench 
or execute the program from shell.


--------------------------------------------------------------------------------
MISCELLANEOUS

The map wraps around at its edges.
The number shown in the top-left corner of the action screen indicates the
  number of frames rendered in the last second
.
Upon returning to AmigaOSPVE prints out:
   * 
the total number of frames rendered;
   * 
the total number of frames shown;
   * 
the average number of frames rendered per second;
   * 
the average time (expressed in framestaken by the rendering of a frame.


--------------------------------------------------------------------------------
TECHNICAL NOTES

The graphics are first rendered in a raster in FAST RAM and then copied to a
  triple
-buffered PED81C raster in CHIP RAM.
The screen resolution is 1020x200 SHRES pixelswhich correspond to 255x200
  LORES
-sized dots and to 128x200 logical dots.
Rendering is done by columnsfrom bottom to top and then left to right.
The code applies a depth of 256 steps per columnso it evaluates 256*128 =
  
32768 dots per frame (and then renders only those which are actually visible).
The code is 100assembly.
The code is optimized for 68030.
The program supports only maps of 1024x1024 pixelsbut it can be made to
  support maps of other sizes by simply redefining the width 
and height
  constants 
and reassembling the code.
The height of the camera adapts automatically to that of the point it is at,
  
but it can be made user-controllable and its maximum value can be increased
  almost to the point that the lanscape disappears at the bottom of the screen
.
On an Amiga 1200 equipped with a Blizzard 1230 IV mounting a 50 MHz 68030 and
  
60 ns RAM:
   * 
the program runs at about 20.2 fps;
   * 
the rendering of graphics alone runs at about 22.2 fps;
   * 
the impact of PED81C is of about 22.2-20.2 2 fps in other words,
     
writing the graphics to the PED81C raster requires about 50/22.2-50/20.2 =
     
0.223 frames (when only the bitplanes DMA is active);
   * 
rendering the graphics directly to the PED81C raster degrades the
     performance by about 2 to 3 fps 
(tested only with an older and less
     optimized version
).
On an Amiga 1200 equipped with a PiStorm32the program runs at 50 fps
  
(unsurprisingly).
The map size is 1024x1024 pixels.
The map requires 2 MB of FAST RAM.
The program takes over the system entirely and returns to AmigaOS cleanly.


--------------------------------------------------------------------------------
BACKSTORY

After a hiatus from programming of several months 
(due to a computer-unrelated
project
), I decided to finally create something for PED81C because I had made
nothing with it other than a few little examples
I wanted to test its
graphical quality 
and computational performance, and... I felt like having some
good fun
.
After some inconclusive mental wanderingthe idea of making a voxel engine came
to mind 
for unknown reasons (I had never dabbled with voxel before).
When the engine was mature enough I decided to distribute PVE publicly (which
initially was not planned
).


About the update, I fixed some palette values in a table in the documentation, added the formulas for calculating DIWSTRT, DIWSTOP, DIWHIGH, DDFSTRT and DDFSTOP to the documentation and implemented them in the AMOS Professional source code example. This is the snippet relative to the register settings:
In generalgiven a raster which is RASTERWIDTH dots wide and RASTERHEIGHT dots
tall
the values to write to the chipset registers in order to create a centered
screen can be calculated 
as follows:
 * 
SCREENWIDTH  RASTERWIDTH 8
 
SCREENHEIGHT RASTERHEIGHT
 
DIWSTRTX     = $81 + (160 SCREENWIDTH 8)
 * 
DIWSTRTY     = $2c + (128 SCREENHEIGHT 2)
 * 
DIWSTRT      = ((DIWSTRTY $ff) << 8) | ((DIWSTRTX 1) & $ff)
 * 
DIWSTOPX     DIWSTRTX SCREENWIDTH 4
 
DIWSTOPY     DIWSTRTY SCREENHEIGHT
 
DIWSTOP      = ((DIWSTOPY $ff) << 8) | (DIWSTOPX $ff)
 * 
DIWHIGH      = ((DIWSTOPX & $100) << 5) | (DIWSTOPY & $700) |
                  ((
DIWSTRTX & $100) >> 3) | (DIWSTRTY >> 8)
 * 
DDFSTRT      = (DIWSTRTX 17) / 2
 
DDFSTOP      DDFSTRT+SCREENWIDTH 8

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@jabiruloQuote:
Build against SDL1.2.15 and 1.2.16 and with .15 it does the same up/down stuck behaviour and with .16 when trying to start game it just goes again to main menu.

This indicates that the problem isn't related to the specific SDL library that Blastaway is linked to and that it's unlikely that the problem is related to SDL at all. I'm quite convinced that the problem lies at a lower (i.e. OS) level.


Edited by saimo on 2023/11/12 21:49:00
RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@AmigaOldskoolerQuote:
Well deserved donations for sure!

And one more arrived - so once again thanks to whoever made it!
EDIT: after posting here, I received yet another donation - and this one beat the highest donation ever, even! You know guys, you should use mt games for competitions more often :D

Quote:
Blastaway is ace!

Glad to hear that, thank you!

Quote:
Would be cool to see more for AmigaOS 4 from you in the future.

Sorry, my future plans include only classic Amiga and Commodore 64 games.

Quote:
Maybe QEMU is an alternative if you don't have a compatible computer?

That's something I had contemplated a while ago, but I just had no time to actually look into it.


Edited by saimo on 2023/11/12 15:11:37
RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@all

One more generous payment arrived, so once again I guess it's somebody from here - thanks a bunch!


@MartinW

:)


@jabirulo

Quote:
tested under windows 7 (the .zip not the installer version).

Plugged the gamepad and without calibrating launched Blastaway.exe and up/down works fine, doesn't get stuck, player moves smoothly

Thanks for the test and the report!
Given that the Blastway code is identical for both Windows and AmigaOS, that tells us that:
a. the joypad hardware is OK;
b. the Blastaway code is OK;
c. the problem must be in the SDL library that the AmigaOS version of Blastway is linked to (1.2.13) or...
d. ... in the AmigaOS/AmigaInput drivers and/or in their configuration.
Since nobody reported this issue before (and, as far as I remember, controllers issues in general, other than the aforementioned issue caused by Windows) relatively to my games (Blastaway, BOH, Huenison and KOG), which all use the same code base and SDL library, I suspect that the problem is d.

If you have the SDK installed, you could try to build Blastaway against an alternative version of SDL as follows:
1. download the objects archive from https://www.retream.com/Blastaway/othe ... away-AmigaOS-objects.lha;
2. unpack the archive somewhere;
3. replace libSDL.a with another static version of SDL of your choice;
4. run make.
Then, put the resulting executable in the Blastaway directory and run it.
Note: I can't offer support if for whatever issue (dependencies, memory faults, etc.) you might stumble upon.

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@VooDoo

:)


@jabirulo

Quote:
Using Dpad and stick same behaviour.

Then SDL is detecting and reporting continuously vertical axis events. I can't do anything about that :/

Could you try the game on Windows using the same controller and possibly another controller with analogue sticks, please?

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@jabiruloQuote:
Using AmigaInput prefs test shows ok, no jitter of sticks.

using SDL gamecontroller for calibarting (took me a while) and then using testgamecontroller ok too.
I'll update my re-calibrated joypad to SDL/SDL2 github ASAP.

I have no idea what SDL gamecontroller and testgamecontroller are.
Did you try with the D-pad? If so, does anything different happen? What happens if you don't touch any control?

It looks like your problem is related to the workaround I have added to have digital controls work under Windows. More precisely, Windows (sometimes?) reports and handles digital controls as analogue (I have verified this personally) and SDL eventually spits out these values:
* up or left: $8000 (-32768 if seen as a signed integer);
* down or right: $7fff (32767 if seen as a signed integer);

So I have added this handler for the axes (analogue directions) events reported by SDL:
static void JH_move_A(SDL_EventeventUint32 data)
{
   
uint16_t d;   // direction

   
event->jaxis.value;
   if (
event->jaxis.axis)
   {
      if (
== 0x8000)
      {
         
PushMovement(SD_U);
      }
      else if (
== 0x7fff)
      {
         
PushMovement(SD_D);
      }
      else
      {
         
PopMovement(SD_U);
         
PopMovement(SD_D);
      }
   }
   else
   {
      if (
== 0x8000)
      {
         
PushMovement(SD_L);
      }
      else if (
== 0x7fff)
      {
         
PushMovement(SD_R);
      }
      else
      {
         
PopMovement(SD_L);
         
PopMovement(SD_R);
      }
   }
}

It does the same thing for both the horizontal and vertical axes, so, given that you're having problems only with the vertical movement, something must happen somewhere between your device and SDL. From the behaviour you described and the code, I guess that SDL, for the vertical axis, is (often/constantly) returning values other than $8000 and $7fff.

Unfortunately I can't offer any further help as I no longer have a working AmigaOS 4 machine, neither have I an analogue controller - and, on top of that, I don't have time to dedicate to development at the moment (and it's been so since quite a few months, i.e. after the release of Ring around the World).


@328gts

:)

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


13 hours ago somebody paid a huge amount for Blastaway, matching the highest payment ever made for any of my games! The visits and the payments for Blastaway (and the same goes for all my games) are so scarce that I guess the generous user must be somebody from here, so... thank you so much!

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@jabirulo

I guess that the Y axis of (at least) one of the analogue sticks is sending jittering data. You should check that they are properly calibrated and send a stable 0 signal when not in use. Maybe the AmigaInput preferences could help with that (I don't know, as I don't have a device with analogue controls). Also, are you using them or the D-pad?

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@jabiruloQuote:
jabirulo wrote:

tested "old" vesions

20191106.2227 works ok
20191112.2338 works ok
v1.5 gamepad moves jerky when going up/dwon.

It looks like your devices have (also) analogue controls. Are they properly calibrated? Do you have the option to disable them and use the digital controls only?

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@jabiruloQuote:
jabirulo wrote:@saimo here when using joystick/gamepad when going up/down player stops (get stuck), and I need to press several times up/down to player "start" again going up/down.

Anything I can try/test to see why happens?


Blastaway v1.5 (2022.07.31)

I have never experienced or heard about something like that.
It must be an issue with your devices/system. Blastaway uses the SDL functions to detect the user input, so, if input doesn't work, there must be some issues with the underlying OS/hardware.
Have you checked your AmigaInput settings? Are your devices reported to be analogue or digital?
I'm afraid I can't do much :/

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@levellordQuote:
levellord wrote:Run out of keys! Not sure did Saimo did some changes to the levels with the new version, I don't remeber having issues with the keys in the past.

Nope, levels never changed.
Tip: not all doors need to be opened (it's a little puzzle element of the game).

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: 2023 - November - Blastaway
Quite a regular
Quite a regular


@all

328gts informed me about this competition, so I'd like to thank you for choosing Blastaway (again), wish you fun and wholeheartedly thank whoever paid a very generous amount for the game just a few hours ago (there had been no purchase since January 2022, so I guess it must be somebody around here) :)

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: PED81C - pseudo-native, no C2P chunky screens for AGA
Quite a regular
Quite a regular


@AmiDARK
Quote:
I must admit that I read doc and didn't understand how it works but I'll do another check and if I find time, I will maybe look to see if I can do something interesting with it using extension format.

EDIT :
From doc I read this :
RGBW
does this mean it is a 32 bit value ? Because after you talk about $ww using $wwwwww ..
I don't understand.
Ew... I think I understand you talk about RGB value for the ColorXX register used for the 4th pixel ? Same for others pixels. Right ?

Key concepts:
* each dot is 8 bit;
* each dot is made of 4 SHRES pixels;
* each SHRES pixel is 2 bit (i.e. it can be assigned 4 different RGB values);
* the RGB values assigned to the SHRES pixels are 24 bit and can be chosen freely.

$wwwwww is a placeholder for any 24 bit value assigned to the W(hite) SHRES pixels in the RGBW mode (e.g. $333333 or $eeeeee).

I hope this helps.

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: PED81C - pseudo-native, no C2P chunky screens for AGA
Quite a regular
Quite a regular


@AmiDARK
Quote:
AmiDARK wrote:Really impressive.

Thanks!

Quote:
Should be a definitive + to Amos Professional as an extension

I wrote the example in AMOS to make it easier to understand by more people, but the system isn't intended for any specific language.
I decided to let programmers implement PED81C in the way that fits best their projects and in their language of choice, given that setting up PED81C screens is easy and given that general-purpose routines would perform worse than tailor-made ones.

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: Ring around the World - out now!
Quite a regular
Quite a regular


@AmigaOldskooler

Thanks a lot!
I hope you'll manage to finish it and enjoy it even more.

RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top


Re: PED81C - pseudo-native, no C2P chunky screens for AGA
Quite a regular
Quite a regular


Uploaded an archive with updated documentation.
While at it, given that I was asked for a source code example, I whipped up an AMOS Professional program that shows how to set up a PED81C screen and to perform some basic operations on it - hopefully, this will be easy to understand and also open the door to AMOS programmers. The program source is included in the archive.

'-----------------------------------------------------------------------------
'
$VERPED81C example 1.3 (28.11.2023) (c2023 RETREAM
'Legal terms: please refer to the accompanying documentation.
'
www.retream.com/PED81C
'contact@retream.com
'
-----------------------------------------------------------------------------

'-----------------------------------------------------------------------------
'
DESCRIPTION
'This shows how to set up a PED81C screen and to perform some basic operations
'
on it.
'Screen features:
equivalent to a 319x256 LORES screen
' * 160 dots wide raster
single buffer
' * blanked border
64-bit bitplanes fetch mode
' * CMYW color model
'
'NOTES
'
The code is written to be readablenot to be general-purpose/optimal.
'-----------------------------------------------------------------------------

'
-----------------------------------------------------------------------------
'GLOBAL VARIABLES

Global RASTERADDRESS,RASTERWIDTH,RASTERHEIGHT,RASTERSIZE

RASTERWIDTH=160
RASTERHEIGHT=256
RASTERSIZE=RASTERWIDTH*RASTERHEIGHT

'
-----------------------------------------------------------------------------
'MAIN

'
Initialize everything.

_INITIALIZE_AMOS_ENVIRONMENT
_INITIALIZE_SCREEN

'If the initialization succeeded, load a picture into the raster and, in case
'
of successexecute a simple effect on it.

If 
Param
   _LOAD_PICTURE_INTO_RASTER
["picture-160x256.raw"]
   If 
Param
      _TURN_DISPLAY_DMA_ON
[0]
      
_RANDOMIZE_RASTER
      _TURN_DISPLAY_DMA_OFF
   End 
If
End If

'Deinitialize everything.

_DEINITIALIZE_SCREEN
_RESTORE_AMOS_ENVIRONMENT

'
-----------------------------------------------------------------------------
'ROUTINES

Procedure _ALLOCATE_BITPLANE[BANKINDEX,SIZE]
   '
--------------------------------------------------------------------------
   
'DESCRIPTION
   '
Allocates a CHIP RAM buffer to be used as a bitplane.
   
'
   '
INPUT
   
'BANKINDEX = index of bank to use
   '
SIZE      size [bytesof bitplane
   
'
   '
OUTPUT
   
'64-bit-aligned bitplane address (0 = error)
   '
   'WARNINGS
   '
The buffer must be freed with Erase BANKINDEX or Erase All.
   
'--------------------------------------------------------------------------

   Trap Reserve As Chip Data BANKINDEX,SIZE+8
   If Errtrap=0 Then A=(Start(BANKINDEX)+7) and $FFFFFFF8

End Proc[A]
Procedure _DEINITIALIZE_SCREEN
   '
--------------------------------------------------------------------------
   
'DESCRIPTION
   '
Deinitializes the screen.
   
'
   '
WARNINGS
   
'Can be called only if the display is off.
   '
--------------------------------------------------------------------------

   
Erase All
   Doke $DFF1FC
,Rem FMODE

End Proc
Procedure _INITIALIZE_AMOS_ENVIRONMENT
   
'--------------------------------------------------------------------------
   '
DESCRIPTION
   
'Ensures the program cannot be interrupted or brought to back, and turns
   '
off the AMOS video system.
   
'--------------------------------------------------------------------------

   Break Off
   Amos Lock
   Comp Test Off
   Auto View Off
   Update Off
   Copper Off
   _TURN_DISPLAY_DMA_OFF

End Proc
Procedure _INITIALIZE_SCREEN
   '
--------------------------------------------------------------------------
   
'DESCRIPTION
   '
Initializes the screen.
   
'
   '
OUTPUT
   
'-1/0 = OK/error
   '
   'WARNINGS
   '
_DEINITIALIZE_SCREEN[] must be called also in case of failure.
   
'
   '
NOTES
   
'Sets RASTERADDRESS.
   '
--------------------------------------------------------------------------

   
'Allocate the raster.

   _ALLOCATE_BITPLANE[10,RASTERSIZE] : If Param=0 Then Pop Proc[0]
   RASTERADDRESS=Param

   '
Allocate and fill the selector bitplanes.

   
_ALLOCATE_BITPLANE[11,RASTERSIZE] : If Param=0 Then Pop Proc[0]
   
B3A=Param
   Fill B3A To B3A
+RASTERSIZE,$55555555

   _ALLOCATE_BITPLANE
[12,RASTERSIZE] : If Param=0 Then Pop Proc[0]
   
B4A=Param
   Fill B4A To B4A
+RASTERSIZE,$33333333

   
'Set the chipset.

   DIWSTRTX=$81+(160-RASTERWIDTH)
   DIWSTRTY=$2C+(128-RASTERHEIGHT/2)
   DIWSTRT=((DIWSTRTY and $FF)*256) or((DIWSTRTX+1) and $FF)
   DIWSTOPX=DIWSTRTX+RASTERWIDTH*2
   DIWSTOPY=DIWSTRTY+RASTERHEIGHT
   DIWSTOP=((DIWSTOPY and $FF)*256) or(DIWSTOPX and $FF)
   DIWHIGH=((DIWSTOPX and $100)*32) or(DIWSTOPY and $700) or((DIWSTRTX and $100)/8) or(DIWSTRTY/256)
   DDFSTRT=(DIWSTRTX-17)/2
   DDFSTOP=DDFSTRT+RASTERWIDTH-8

   Doke $DFF092,DDFSTRT
   Doke $DFF094,DDFSTOP
   Doke $DFF08E,DIWSTRT
   Doke $DFF090,DIWSTOP
   Doke $DFF1E4,DIWHIGH

   Doke $DFF100,$4241 : Rem BPLCON0
   Doke $DFF102,$10 : Rem BPLCON1
   Doke $DFF104,$224 : Rem BPLCON2
   Doke $DFF108,0 : Rem BPLMOD1
   Doke $DFF10A,0 : Rem BPLMOD2
   Doke $DFF1FC,$3 : Rem FMODE

   '
Set COLORxx.

   
Doke $DFF106,$20 Rem BPLCON3
   Doke $DFF180
,0
   Doke $DFF182
,$88
   Doke $DFF184
,$88
   Doke $DFF186
,$FF
   Doke $DFF188
,0
   Doke $DFF18A
,$808
   Doke $DFF18C
,$808
   Doke $DFF18E
,$F0F
   Doke $DFF190
,0
   Doke $DFF192
,$880
   Doke $DFF194
,$880
   Doke $DFF196
,$FF0
   Doke $DFF198
,0
   Doke $DFF19A
,$888
   Doke $DFF19C
,$888
   Doke $DFF19E
,$FFF
   Doke $DFF106
,$220 Rem BPLCON3
   Doke $DFF180
,0
   Doke $DFF182
,0
   Doke $DFF184
,0
   Doke $DFF188
,0
   Doke $DFF18A
,0
   Doke $DFF18C
,0
   Doke $DFF190
,0
   Doke $DFF192
,0
   Doke $DFF194
,0
   Doke $DFF198
,0
   Doke $DFF19A
,0
   Doke $DFF19C
,0
   Doke $DFF106
,$20 Rem BPLCON3

   
'Build a Copperlist that sets the bitplanes pointers.

   Cop Movel $E0,RASTERADDRESS
   Cop Movel $E4,RASTERADDRESS
   Cop Movel $E8,B3A
   Cop Movel $EC,B4A
   Cop Swap

End Proc[-1]
Procedure _LOAD_PICTURE_INTO_RASTER[FILEPATH$]
   '
--------------------------------------------------------------------------
   
'DESCRIPTION
   '
Loads a raw 8-bit chunky picture into the rasterensuring that its size
   
'is correct.
   '
   'IN
   '
FILEPATHS path of picture file
   
'
   '
OUTPUT
   
'-1/0 = OK/error
   '
--------------------------------------------------------------------------

   
Trap Open In 1,FILEPATH$ : If Errtrap Then Pop Proc[0]
   
L=Lof(1)
   
Close(1)
   If 
L<>RASTERSIZE Then Pop Proc[0]
   
Trap Bload FILEPATH$,RASTERADDRESS

End Proc
[Errtrap=0]
Procedure _RANDOMIZE_RASTER
   
'--------------------------------------------------------------------------
   '
DESCRIPTION
   
'Randomizes the raster by swapping 16 dots per frame, until a mouse button
   '
is pressed.
   
'--------------------------------------------------------------------------

   XM=RASTERWIDTH-1
   YM=RASTERHEIGHT-1
   Repeat
      C=16
      While C
         X0=Rnd(XM)
         Y0=Rnd(YM)
         X1=Rnd(XM)
         Y1=Rnd(YM)
         A0=Y0*RASTERWIDTH+X0+RASTERADDRESS
         A1=Y1*RASTERWIDTH+X1+RASTERADDRESS
         C0=Peek(A0)
         Poke A0,Peek(A1)
         Poke A1,A0
         Dec C
      Wend
      _WAIT_SCREEN_BOTTOM
   Until Mouse Click

End Proc
Procedure _RESTORE_AMOS_ENVIRONMENT
   '
--------------------------------------------------------------------------
   
'DESCRIPTION
   '
Restores the AMOS environment.
   
'--------------------------------------------------------------------------

   Copper On
   Update On
   Auto View On
   Amos Unlock
   Break On
   _TURN_DISPLAY_DMA_ON[$20]

End Proc
Procedure _TURN_DISPLAY_DMA_OFF
   '
--------------------------------------------------------------------------
   
'DESCRIPTION
   '
Disables the bitplanesCopper and sprites DMA.
   
'--------------------------------------------------------------------------

   _WAIT_SCREEN_BOTTOM
   Doke $DFF096,$3A0 : Rem DMACON

End Proc
Procedure _TURN_DISPLAY_DMA_ON[SSPRITESFLAG]
   '
--------------------------------------------------------------------------
   
'DESCRIPTION
   '
Enables the bitplanes and Copper DMA.
   
'
   '
INPUT
   
'SSPRITESFLAG = $20/0 = turn / do not turn sprites on
   '
   'WARNINGS
   '
The chipset must have been set up properly.
   
'--------------------------------------------------------------------------

   _WAIT_SCREEN_BOTTOM
   Doke $DFF096,$8380 or SSPRITESFLAG : Rem DMACON

End Proc
Procedure _WAIT_SCREEN_BOTTOM
   '
--------------------------------------------------------------------------
   
'DESCRIPTION
   '
Waits for the bottom of the screen.
   
'--------------------------------------------------------------------------

   While Deek($DFF004) and $3 : Wend
   Repeat : Until(Leek($DFF004) and $3FF00)>$12C00

End Proc


Edited by saimo on 2023/11/28 23:02:09
Edited by saimo on 2023/11/29 12:13:47
RETREAM - retro dreams for Amiga, Commodore 64 and PC
Go to top



TopTop
(1) 2 3 4 ... 33 »




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project